Reputation: 16784
Use-case: Upload a simple image file to a server, which clients could later retrieve
Designate a FTP Server
for the job.
HTTP Put
: It can directly upload files to a server without the need of a server side
component to handle the bytestream.
HTTP Post
: Handle the bytestream by the server side component.
Upvotes: 2
Views: 4033
Reputation: 2317
I think to safely use PUT on a public website requires even more effort than using POST (and is less commonly done) due to potential security issues. See http://bitworking.org/news/PUT_SaferOrDangerous.
OTOH, I think there are plenty of resources for safely uploading files with POST and checking them in the server side script, and that this is the more common practice.
Upvotes: 1
Reputation: 70001
What I usually do (via PHP) is HTTP POST.
And employ PHP's move_uploaded_file()
to get it to whatever destination I want.
Upvotes: 0
Reputation: 189736
PUT
is only appropriate when you know the URL you are putting to.
You could also do:
4) POST
to obtain a URL to which you then PUT
the file.
edit: how are you going to get the HTTP server to decide whether it is OK to accept a particular PUT request?
Upvotes: 0