-
Notifications
You must be signed in to change notification settings - Fork 120
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
The return JSON data is not compatible with jQuery File Upload Plugin's requirement #23
Comments
@ibusybox Nice Job !!! |
Still broken. Line 19 of 'filehandler.js' needs to be changed to
|
Fought this issue for several days... if you use the NEWEST code across the board (e.g. latest middleware + latest JQuery File Upload code), you need to change Line 19 to: res.json(200, result) |
@stmaurice cause not updated npm. please use git repos directly |
Agreed. The NPM is not up to date and doesn't quite work with the newest JQuery version. Repos DO work with the fix above :) (e.g. res.json(200, { files: result }) ) Can someone fix the NPM? The instructions posted in the readme don't work because its not up to date. |
hey, will update it soon |
I've just released 0.1.0. It works for me with the latest blueimp's code - eg go to examples, npm install, node app.js, upload / delete works fine. Please let me know if it works for you. |
Hi i am working with java. I have same problem. I tired to find filehandler.js in my project. But it is not there. Will someone guide me how to change it. Or any other alternative to this is available. Thank you in advance. |
Hi,
I am using jQuery File Upload Plugin's client code and jquery-file-upload-middleware as backend server.
I found a problem is that the jquery-file-upload-middleware return JSON data is not compatible with jQuery File Upload Plugin's requirement, then the problem "Empty file upload result" is always represent. However, the file is upload succeed, just the client can not properly display the result.
I catch the request and found the return JSON data is:
[
{
"name": "iPhone5 docking station.jpeg",
"originalName": "iPhone5 docking station.jpeg",
"size": 9584,
"type": "image/jpeg",
"delete_type": "DELETE",
"url": "http://localhost/uploads/iPhone5%20docking%20station.jpeg",
"delete_url": "http://localhost/product/upload/iPhone5%20docking%20station.jpeg",
"thumbnail_url": "http://localhost/uploads/thumbnail/iPhone5%20docking%20station.jpeg"
}
]
And i google this issue found a issue on jQuery File Upload Plugin's page: blueimp/jQuery-File-Upload#365
There @OneDivZero said the latest jQuery File Upload Plugin's JSON format was changed from: [{file1}, {file2}] to: {files: [{file1}, {file2}]}.
So i try to change the jquery-file-upload-middleware code in lib/filehandler.js:
//res.json(200, result);
//MODIFY & TODO, should sumbit issue to the https://github.com/aguidrevitch/jquery-file-upload-middleware
res.json(200, {files: result});
Then everything is fine.
Is this a bug?
The text was updated successfully, but these errors were encountered: