Download file amazon s3 php






















Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Zip and download files from Amazon s3 with php Ask Question.

Asked 7 years, 1 month ago. Active 7 years, 1 month ago. Viewed 13k times. Thank you in advance for your help and advice. Improve this question. Community Bot 1 1 1 silver badge. KDhyne KDhyne 1 1 gold badge 1 1 silver badge 14 14 bronze badges.

They don't deal with URLs. Add a comment. Active Oldest Votes. Marc B's comment is correct. Improve this answer. Derek Kurth Derek Kurth 1, 1 1 gold badge 18 18 silver badges 19 19 bronze badges. Thank you for your tips Derek. I've changed my script to use S3's getObject with the option to save the file in local storage. Referencing the location of the file in the local directory seems to create a zip package as I'd hoped, but when I echo the result I get a giant string of binary representing my zip file rather than a prompt to download it.

What else could I be missing? Are you echoing anything before your header 'Content-type Basically, if any character is sent before the headers, that would cause what you describe. Still no dice.

I've cut my script down to the necessities and tried your suggestions. I've edited my original post with what I currently have. The only thing I can think of is that perhaps the jquery I'm using to call the php script is to blame? If there's nothing you can see wrong with it though, I may have to look for another approach. Thank you for your help.

I think the problem is the line: echo "Starting zip test"; You are sending a response to the browser BEFORE the content headers, so the headers are being ignored. I've added an edit below the original post.

I took out that echo statement after your first comment. Sorry for the confusion. Tom Tom 12k 47 47 gold badges silver badges bronze badges. Add a comment. Active Oldest Votes. Improve this answer. Daniel Katzan Daniel Katzan 1 1 gold badge 7 7 silver badges 27 27 bronze badges. You're trying to download a pdf as a binary content type data. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.

The Overflow Blog. Who owns this outage? Building intelligent escalation chains for modern SRE. Podcast Who is building clouds for the independent developer? Featured on Meta. Now live: A fully responsive profile. Reducing the weight of our footer.



0コメント

  • 1000 / 1000