Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

DELETE doesn't work. #2133

Closed
deviprsd opened this issue Mar 8, 2013 · 9 comments
Closed

DELETE doesn't work. #2133

deviprsd opened this issue Mar 8, 2013 · 9 comments

Comments

@deviprsd
Copy link

deviprsd commented Mar 8, 2013

Hi,
This is the website where i added the upload widget..
http://titans.byethost3.com/upload/

Upload is working fine..but not delete...please give me a solution
I'm tired of checking support section without getting any satisfactory result

@blueimp blueimp closed this as completed Mar 8, 2013
@wolfgang818
Copy link

Read the instructions for PHP

https://groups.google.com/forum/#!topic/jquery-fileupload/HjgQmFfE4Ok

@deviprsd
Copy link
Author

deviprsd commented Mar 8, 2013

Thanks for helping....blueimps method works...sorry i didn't try the other method
https://github.com/blueimp/jQuery-File-Upload/blob/master/server/php/UploadHandler.php#L45
Change this : 'delete_type' => 'DELETE'
to : 'delete_type' => 'POST'

@blueimp
Copy link
Owner

blueimp commented Mar 8, 2013

Enabling the user_dirs option will not enable DELETE requests, if the server doesn't support it.
The user_dirs option also does not replicate the demo behavior. The demo simply doesn't list uploaded files on reload, which resembles the user_dirs option but is not the same.

If you cannot change your server config to allow DELETE requests, POST can be used instead.

The quote in the code line I referred to above says the following:

        // Set the following option to 'POST', if your server does not support
        // DELETE requests. This is a parameter sent to the client:
        'delete_type' => 'DELETE',

This means you simply have to edit /server/php/UploadHandler.php and replace the line

            'delete_type' => 'DELETE',

with

            'delete_type' => 'POST',

A cleaner solution would be to override this UploadHandler class, but this requires more coding.

Please note that my reply here is an exception, since this bug tracker is only meant for bug reports, not for any kind of support requests.
If you cannot get user support on the support forum, you might wanna try posting your question to StackOverflow.

@castea-webdev
Copy link

Thanks for your great softwares.
Just for you info, there was a solution to similar problem for django python implemention jquery file upload, that is DELETE causing 403 forbidden.
sigurdga/django-jquery-file-upload#14
Here is the solution:
sigurdga/django-jquery-file-upload@297bc51

But i cannot managed to use it on php implementation of the demo. Maybe there are some talented coders to implement it?

@ve3
Copy link

ve3 commented Apr 4, 2014

Hello,

Is there a way to add additional data with delete process? such as add csrf protection data to it.
I don't see add data to delete process in document.

@pcopley
Copy link

pcopley commented Jun 9, 2014

@ve3 That is literally the only example in the documentation (also here on Github) about extending callbacks.

@robov
Copy link

robov commented Jul 30, 2014

When I try to delete I get this json retunr: {"files":[{"name":"1406712510-48","size":0,"type":"","error":"File is too small"}]}

There is no filename by that name.
I use user_dirs = true, and delete_type=post

Any suggestions ?

@robov
Copy link

robov commented Jul 30, 2014

When I disable delete_type (and use the default in the constructor)
then I get: {"":false} as a result, but nothing is deleted

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants