httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bennett, Tony" <Bennett.T...@con-way.com>
Subject RE: [users@httpd] Web Dav overwrite files
Date Mon, 21 Jan 2013 16:12:55 GMT
Johan,

It is working.... examine radar.bin ... it should have been successfully updated.

A successful PUT on a resource that does not exist previously, will generate a 201 Created
response.
A successful PUT on a resource that already exists will generate a 204 No Content.

RFC 2616 (HTTP 1.1) says the following:
    9.6 PUT
    The PUT method requests that the enclosed entity be stored under the supplied Request-URI.
If the Request-
    URI refers to an already existing resource, the enclosed entity SHOULD be considered as
a modified version of the
    one residing on the origin server. If the Request-URI does not point to an existing resource,
and that URI is
    capable of being defined as a new resource by the requesting user agent, the origin server
can create the resource
    with that URI. If a new resource is created, the origin server MUST inform the user agent
via the 201 (Created)
    response. If an existing resource is modified, either the 200 (OK) or 204 (No Content)
response codes SHOULD be
    sent to indicate successful completion of the request.

HTH,
-tony

-----Original Message-----
From: Johan Moraal [mailto:johan.moraal@gmail.com] 
Sent: Monday, January 21, 2013 12:26 AM
To: users@httpd.apache.org
Subject: [users@httpd] Web Dav overwrite files

Hi All

How do I setup the Web Dav module to allow overwriting of files on the server?

Example:
The first time I send a file to the server I get this:

Client request:
> PUT /radar%2Ebin HTTP/1.1
> User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3
libidn/1.15
> Host: 10.84.67.129
> Accept: */*
> Content-Length: 31457280
> Expect: 100-continue

Server respone:
< HTTP/1.1 201 Created
< Date: Mon, 21 Jan 2013 09:52:31 GMT
< Server: Apache/2.0.64 (Unix) PHP/5.0.4 DAV/2
< Location: http://10.84.67.129/radar.bin
< Content-Length: 276
< Content-Type: text/html; charset=ISO-8859-1

Now the file "radar.bin" is created on my server, but I want to
overwrite it so I do this:
Client Request:
> PUT /radar%2Ebin HTTP/1.1
> User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3
libidn/1.15
> Host: 10.84.67.129
> Accept: */*
> Content-Length: 31457280
> Expect: 100-continue

Server reponse:
< HTTP/1.1 204 No Content
< Date: Mon, 21 Jan 2013 09:52:42 GMT
< Server: Apache/2.0.64 (Unix) PHP/5.0.4 DAV/2
< Content-Length: 0
< Content-Type: application/octet-stream


I use the curl utility as a client:
curl -v -o resp23.htm -T "radar.bin" --noproxy 10.84.67.129 10.84.67.129


--
Johan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message