myforwik
myforwik

Reputation: 195

HTTP PUT a file

Does anyone have code of a simple web browser file/script (HTML/javascript/whatever) that can upload a user selected file to a server using HTTP PUT?

Everything I keep reading says that browsers do support HTTP put, but just not through any scripting?!

What is the most common way to upload a file then? Using post??

Upvotes: 0

Views: 233

Answers (1)

laher
laher

Reputation: 9110

It's normally a POST, using a form with a special attribute: enctype="multipart/form-data"

You'll need a server-side technology to accept the file and then do something with it.

I guess plain old PHP is a cheap and easy way to achieve this, but I guess you probably have an existing website or something which you're trying to work with, right?

Here's a php tutorial, (there's millions out there): http://www.tizag.com/phpT/fileupload.php

Upvotes: 3

Related Questions