You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ben Timby <bt...@gmail.com> on 2011/07/13 23:34:52 UTC

[users@httpd] HTTP PUT to truncate a file.

I am working with WebDAV on apache and I have figured out how to use
the Content-Range header to append to a file.

Request 1:
HTTP/1.1 PUT /file
Host: node0
Content-Length: 1

a

* /file now: a

Request 2:
HTTP/1.1 PUT /file
Host: node0
Content-Range: 1-4/*
Content-Length: 3

aaa

* /file now: aaaa

Now I would like to truncate a file...

HTTP/1.1 PUT /file
Host: node0
Content-Range: 2-4/*
Content-Length: 0

But this does not work. Any pointers? I can truncate the file to 0
bytes easily, but I want to truncate it to an arbitrary length.

Thanks.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org