Delete files via POST and DELETE requests

Updates since the original post/feature implementation

In Fine Uploader 3.3, the ability to easily delete uploaded files was added as a new feature. At that time, all associated delete file requests sent by the library were DELETE requests only. While this is the most appropriate verb to use when performing this type of action, it became clear that some users are not able to handle DELETE requests server-side due to restrictions placed on firewalls/appliances/servers that are beyond their control. So, in Fine Uploader 3.7, you will now be able to choose between DELETE or POST as the method type for these delete file requests.

A new property of the deleteFile option has been added: method. method has two valid values: “DELETE” and “POST”.

If you choose “DELETE”, all delete file requests will be sent using a DELETE request, with the file UUID at the end of the URI and any additional parameters URL encoded in the query string. You can read more about deleting files with the DELETE request in the original delete file feature blog post. This is the only way the delete file feature has sent requests until now.

If you choose “POST”, all delete file requests will be sent using a POST request, with the file UUID sent as a (by default) “qquuid” parameter along with a “_method” parameter sent with a value of “DELETE”. The “_method” parameter is named as such as this seems to be a commonly accepted convention, according to RESTful Web Services, among other sources such as discussions on Stackoverflow. Also please note that all parameters for this POST request are sent, URL encoded, in the request payload, which is also commonly accepted. Valid status codes for this POST request are 200 and 204, per the HTTP spec. Please also note that the name of the “qquuid” parameter is configurable via the uuidName property of the request option.

Other than that, everything is about the same with the delete file feature. Again, see the original blog post on this feature if you require a refresher, but keep the new method property in mind.

Happy Uploading!

Ray Nicholus and the rest of Widen