开发者

HTTP PUT a file

开发者 https://www.devze.com 2022-12-29 08:37 出处:网络
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?

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

精彩评论

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