Re: Using POST to send bitmap image with Java
- From: Dave Miller <nonregistered@xxxxxxxxxxxx>
- Date: Sat, 31 May 2008 04:38:41 GMT
Arne Vajhøj wrote:
Kenneth P. Turvey wrote:I'm actually in the process of doing this right now. I'm going to be posting the image to a URL that is a PHP script. When I was looking at this I thought that this really made more sense to use a PUT method to post the image, but the guy working on the PHP side insisted on using a POST method.
Is there a reason that POST would be selected over PUT for this application? Are there reasons to go with PUT here?
PUT file
uploads a file to specified name via a builtin mechanism
in the web server.
Apache does not use PUT except via mod_dav (WebDAV). A handler must be built for everything but GET.
POST uploadscript
send a file to the specified script that can save it as
a file or in a database or whatever.
Not all web servers support or is configured to allow PUT,
while POST is supported by all web servers.
While the above statement is true, it is no longer common to disable PUT and DELETE server wide because WebDAV requires both. It was never common to limit POST but the limit has always been available on Apache.
With POST you can also use form based multi part where you
can upload additional info about the file and multiple files
in a single POST.
POST is designed to allow a uniform method to cover the following functions:
- Annotation of existing resources;
- Posting a message to a bulletin board, newsgroup, mailing list,
or similar group of articles;
- Providing a block of data, such as the result of submitting a
form, to a data-handling process;
- Extending a database through an append operation.
The PUT method requests that the enclosed entity be stored under the supplied Request-URI.
The reason why the PHP guy wants a POST may be the following. When you send a PUT, the servers config has to tell it what handler to use - the URI is the target file of the PUT. With a POST, the URI is the handler - no modification of the config needed.
Arne
--
Dave Miller
Java Web Hosting at:
http://www.cheap-jsp-hosting.com/
.
- Follow-Ups:
- Re: Using POST to send bitmap image with Java
- From: Arne Vajhøj
- Re: Using POST to send bitmap image with Java
- References:
- Using POST to send bitmap image with Java
- From: Dexter
- Re: Using POST to send bitmap image with Java
- From: Dave Miller
- Re: Using POST to send bitmap image with Java
- From: Kenneth P. Turvey
- Re: Using POST to send bitmap image with Java
- From: Arne Vajhøj
- Using POST to send bitmap image with Java
- Prev by Date: Re: JSP XML with DOM
- Next by Date: Java/J2EE | C++,VC++,.Net | Testing Openings at Intuit
- Previous by thread: Re: Using POST to send bitmap image with Java
- Next by thread: Re: Using POST to send bitmap image with Java
- Index(es):
Relevant Pages
|