Angular + Symfony file upload with AWS S3

First, using the fantastic work of Jenny Louthan of Uncorked Studios, implement this directive:

Secondly, write the Angular function to handle the upload:

Third, write the action in Symfony to process the file upload, with the proper route:

path/to/routes.yml

path/to/MyController.php

Now, referencing my previous post on setting up Liip + Gaufrette + AwsS3 I’ll assume you’ve configured and set that up properly. Given that, you’d adjust your imageUploadAction as follows.

However, to start, you’ll need a FileManager service to properly manage the files to Aws S3 as configured.

app/config/parameters.yml

app/config/services.yml

Services/FileManager.php

Finally, the whole Action:

 

Leave a Reply

Your email address will not be published. Required fields are marked *