Download file s3 php






















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. Show 5 more comments. 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. Linked How can I download file from s3 in php. The following code not working for me Improve this question. Nikhil Thombare. Nikhil Thombare Nikhil Thombare 1 1 gold badge 9 9 silver badges 24 24 bronze badges. This might be a version issue. Which version of aws are you using? Add a comment. Active Oldest Votes. Statically e,g; SgetObject Improve this answer.

Kaleem Ullah Kaleem Ullah 5, 2 2 gold badges 38 38 silver badges 44 44 bronze badges. Jason Jason 4 4 silver badges 15 15 bronze badges. 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?



0コメント

  • 1000 / 1000