The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End php download multiple files problem. Reply To: php download multiple files problem.


Good morning __ :)

Yes I have verified my JS is sending the correct values. Not only did I check the $_POST value against the hard coded php value and they match, but I’ve also tried hard coding the image filename into the javascript to 100% certain as best I can (with my limited knowledge) that i’m sending the correct image names in the correct comma delimited format. Also remember the php file is correctly zipping the passed image(s), it’s just not downloading.

What appears to be going wrong is the file is being sent back to the javascript instead of being downloaded. I can see this by doing an alert in the JS. I see the binary garbage in the alert.

So the questions are:

1.What am I doing wrong that the file is being sent to the javascript instead of being downloaded by the browser?

2.Is there a way to have javascript send a value to the php script where the javascript does not get anything back?

  1. Is there a way to have my javascript page actually handle the binary data being passed to it to make it download?

In my latest tests I’ve had the javascript send the filename directly to the php download script and it still does not download. It sends the file back to the javascript…
So there must be some javascript setting I’m doing wrong.

Gonna try using GET but now I have to rewrite the php scripts to go back to using only 1 script to handle both the zip and the dl.

I’ve also tried different browsers with no change in what happens.

__, Do your scripts actually work?
Should I test them or were they just examples?
Could you test my scripts on your website and see if you get the same results (the binary going back to the JS and not being downloaded)?

If I don’t get a solution here soon I may have to post this problem on stack or elsewhere.

I’ll be rereading my JS stuff but in the meantime open for more suggestions and help please!

Thank you for your help.