Link to home
Start Free TrialLog in
Avatar of Alex Lord
Alex Lord

asked on

Getting file upload from AWS S3

Hey

So i use Amazon S3 upload file to store uploaded Files,

Now what im trying to do is  a custom attach document to a email which i am using phpmailer to attach, my issue is im not sure how to get the file from Amazon S3 and attach it to the PHPMailer.

I have only front end and jq setup, where you click on a attachment which sends a ajax request to the backend which uses a file path to go to the S3 but im not sure how to bring back the file to pass into phpMailer.

any tips or advice ?
Avatar of David Favor
David Favor
Flag of United States of America image

To accomplish this, "Now what im trying to do is  a custom attach document to a email which i am using phpmailer to attach, my issue is im not sure how to get the file from Amazon S3 and attach it to the PHPMailer."

You will do this...

1) No mail client has the ability to access an S3 asset, so you must make this asset available to mail clients.

2) If the asset is large, you'll download it from S3 to some public facing Website + reference the URL in your email.

3) If the asset is small, you'll download it from S3 to local storage, then embed an inline version of the asset in your email, then delete the local asset when you're finished sending your email.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial