swoosh
swoosh

Reputation: 657

Uploading a file with jquery and sending as a PUT

Does anyone know how to upload a file using a form and then have jquery intercept it, modify the file and then send it off with ajax using http PUT instead of POST? I've tried using the jquery form plugin, but it doesn't work with PUTs, has anyone else had to do something like this before? An example would be very helpful.

Upvotes: 0

Views: 3070

Answers (2)

Porco
Porco

Reputation: 4203

Just pass in a "type" key.

$.ajax({
  url: 'ajax/test.html',
  type: 'PUT'
});

Note that PUT is not supported by all browsers.

Upvotes: 1

secretformula
secretformula

Reputation: 6432

http://homework.nwsnet.de/news/9132_put-and-delete-with-jquery

That is some example code to get you started. You just have to add a method for put

Upvotes: 1

Related Questions