Reputation: 4130
I have an AJAX form in my ZF2 application. I want to handle file uploads. The JavaScript code I have written to handle the form submission can be found here. How do I send the uploaded file's details to my PHP script? My current code just sends the file name.
Appreciate any help.
Upvotes: 3
Views: 1814
Reputation: 947
Checkout the new FileReader. It is already supported in most browsers. Basically it reads in the File you want to upload, so you can append it in a Post request as a string argument.
https://developer.mozilla.org/en-US/docs/Web/API/FileReader
Upvotes: 0