Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.4 file uploads are zero length #137

Closed
dleffler opened this issue Jan 2, 2016 · 5 comments
Closed

v2.4 file uploads are zero length #137

dleffler opened this issue Jan 2, 2016 · 5 comments

Comments

@dleffler
Copy link

dleffler commented Jan 2, 2016

I've been using this product for several years, but after moving from v2.3 to v2.4 it seems to have broken something. This upload is handled within php as an XHR but the
file_put_contents($_destFullPath, file_get_contents('php://input'));
only creates a zero-length file with no errors reported. Reverting back to the v2.3 file restores functionality.

@LPology
Copy link
Owner

LPology commented Jan 3, 2016

In your Javascript code, set this option for the uploader: multipart: false

The default for multipart was changed from false to true with version 2.4 (indicated in the changelog).

@dleffler
Copy link
Author

dleffler commented Jan 3, 2016

I've tried that, but then it doesn't send back any parameters in $_REQUEST/$_GET (the 'data' parameter), nor is the name or filename sent

@LPology
Copy link
Owner

LPology commented Jan 3, 2016

Try setting noParams: false along with multipart: false

@dleffler
Copy link
Author

dleffler commented Jan 3, 2016

That seems to have done the trick, required explicitly setting both (back) to false. Thanks!

@LPology
Copy link
Owner

LPology commented Jan 3, 2016

Glad to help.

And sorry for the annoyance. The reason for the change is that I think it will make it easier for people to use the plugin going forward by defaulting to the more broadly accepted method of uploading files (multipart form).

I'll update the Changelog with a little more detail. Let's also leave this issue open for a little while to make it easier to find in case anyone else comes across the same problem. Thanks for bringing it up.

@LPology LPology closed this as completed Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants