开发者

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??


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜