Search code examples
phpjqueryjquery-file-upload

jQuery-File-Upload Plugin - 501 (Not Implemented)


This question is about: https://github.com/blueimp/jQuery-File-Upload

This question is very specific. I did not develop the code so I don't know where went wrong at when.

I copied to whole repository to my Windows web host running PHP 5.3 following the setup, however, using Firefox and Chrome to visit the demo page, I can upload but cannot delete. The Windows server is old, still running IIS6.

The console has logged:

Firefox:
no element found

Chrome:(1st click)
Failed to load resource: the server responded with a status of 501 (Not Implemented) :http://webhost/folder/jquery-file-upload/server/php/?file=xxx.jpg

Chrome:(2nd click)
DELETE http://webhost/folder/jquery-file-upload/server/php/?file=xxx.jpg 501 (Not Implemented) 
                                  jquery.min.js:4
send                              jquery.min.js:4
n.extend.ajax                     jquery.min.js:4
$.widget.options.destroy          jquery.fileupload-ui.js:377
$.Widget._trigger                 jquery.ui.widget.js:489
$.widget._deleteHandler           jquery.fileupload-ui.js:537
(anonymous function)              jquery.ui.widget.js:105
handlerProxy                      jquery.ui.widget.js:406
n.event.dispatch                  jquery.min.js:3
r.handle                          jquery.min.js:3

And that linked to php:1 with this:

{"file":{"name":"xxx.png","size":14339,"url":"http:\/\/webhost\/folder\/jquery-file-upload\/server\/php\/files\/xxx.png","thumbnailUrl":"http:\/\/www.newman.edu.hk\/appreciate\/jquery-file-upload\/server\/php\/files\/thumbnail\/xxx.png","deleteUrl":"http:\/\/webhost\/folder\/jquery-file-upload\/server\/php\/?file=xxx.png","deleteType":"DELETE"}}

I tried to check the UploadHandler.php but the whole file seems cryptic to me x_x


Solution

  • Here reporting, for whatever reason. I tried that again with the latest library and it worked. Sorry I can't provide further details or help you if you are currently frustrated because I never recorded them. :(

    Anyway, that is how I solved the problem.


    I am also sorry to say the other answers didn't work for me and I didn't remember to comment because I can't access the server at home and forgot after fiddling with it. Please forgive me :P


    P.S. I also switched to Dropzone.js because jQuery File Upload is too uneasy to use. I personally think Dropzone.js allows more freedom because it doesn't require any dependencies.

    Here is how they themed Dropzone.js to look like jQuery File Upload: http://www.dropzonejs.com/bootstrap.html