# Webdav upload and wrong modify time stamp (0.7.65, 0.8.34)

**URL:** <https://www.ruby-forum.com/t/webdav-upload-and-wrong-modify-time-stamp-0-7-65-0-8-34/186014>\
**Category:** NGINX\
**Created:** [March 30, 2010, 1:16pm UTC](https://www.ruby-forum.com/t/webdav-upload-and-wrong-modify-time-stamp-0-7-65-0-8-34/186014 "2010-03-30T13:16:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcin\_Engelmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/47e85d/32.png) [@Marcin\_Engelmann](https://www.ruby-forum.com/u/Marcin_Engelmann)\
**Post date:** [March 30, 2010, 1:16pm UTC](https://www.ruby-forum.com/t/webdav-upload-and-wrong-modify-time-stamp-0-7-65-0-8-34/186014/1 "2010-03-30T13:16:57Z")

</div>

Hello,

I noticed that uploading file (webdav) when client\_body\_temp\_path and  
document root are on different partitions sets access and modify time  
stamps to 1970-01-01 instead of valid time. It works fine if  
client\_body\_temp\_path and document root are on the same partition.

I tested nginx 0.7.65 and 0.8.34, both on Debian lenny.

1. Test partition: ext3, default mount options

# mount -o defaults -t ext3 /dev/sda3 /home/nginx-test

1. client\_body\_temp\_path and document root on different partitions  
root /home/nginx-test/upload  
client\_body\_temp\_path /tmp

# curl -T test.txt [http://127.0.0.1:8080/test.txt](http://127.0.0.1:8080/test.txt)

# stat /home/nginx-test/upload/test.txt

File: `/home/nginx-test/upload/test.txt’  
Size: 5 Blocks: 8 IO Block: 4096 regular file  
Device: 803h/2051d Inode: 22896642 Links: 1  
Access: (0640/-rw-r-----) Uid: ( 33/www-data) Gid: ( 33/www-data)  
Access: 1970-01-01 00:59:59.000000000 +0100  
Modify: 1970-01-01 00:59:59.000000000 +0100  
Change: 2010-03-30 10:53:22.000000000 +0200

Wrong access and modify.

1. client\_body\_temp\_path and document root on the same partition  
root /home/nginx-test/upload  
client\_body\_temp\_path /home/nginx-test/tmp

# curl -T test.txt [http://127.0.0.1:8080/test2.txt](http://127.0.0.1:8080/test2.txt)

# stat /home/nginx-test/upload/test2.txt

File: `/home/nginx-test/upload/test2.txt’  
Size: 5 Blocks: 8 IO Block: 4096 regular file  
Device: 803h/2051d Inode: 15564807 Links: 1  
Access: (0640/-rw-r-----) Uid: ( 33/www-data) Gid: ( 33/www-data)  
Access: 2010-03-30 10:57:28.000000000 +0200  
Modify: 2010-03-30 10:57:28.000000000 +0200  
Change: 2010-03-30 10:57:28.000000000 +0200

Access and modify are OK.

1. My nginx.conf  
user www-data;  
pid /var/run/nginx.pid;  
error\_log /var/log/nginx/error.log;

events {  
}

http {  
server {  
listen 127.0.0.1:8080;  
access\_log /var/log/nginx/access.log;  
root /home/nginx-test/upload;

```
client_max_body_size 4g;
create_full_put_path on;
client_body_temp_path /home/nginx-test/tmp;
# client_body_temp_path /tmp;
dav_methods PUT DELETE MKCOL MOVE;
dav_access user:rw group:r;

```

}  
}

## Best regards,

Marcin Engelmann

---

<div class="post-metadata">

**Author:** ![Marcin\_Engelmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/47e85d/32.png) [@Marcin\_Engelmann](https://www.ruby-forum.com/u/Marcin_Engelmann)\
**Post date:** [March 30, 2010, 1:35pm UTC](https://www.ruby-forum.com/t/webdav-upload-and-wrong-modify-time-stamp-0-7-65-0-8-34/186014/2 "2010-03-30T13:35:02Z")

</div>

Hello!

On Tue, Mar 30, 2010 at 01:16:00PM +0200, Marcin Engelmann wrote:

> I noticed that uploading file (webdav) when client\_body\_temp\_path and  
> document root are on different partitions sets access and modify time  
> stamps to 1970-01-01 instead of valid time. It works fine if  
> client\_body\_temp\_path and document root are on the same partition.

Try the attached patch.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Marcin\_Engelmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/47e85d/32.png) [@Marcin\_Engelmann](https://www.ruby-forum.com/u/Marcin_Engelmann)\
**Post date:** [March 30, 2010, 2:28pm UTC](https://www.ruby-forum.com/t/webdav-upload-and-wrong-modify-time-stamp-0-7-65-0-8-34/186014/3 "2010-03-30T14:28:19Z")

</div>

Dnia 2010-03-30, wto o godzinie 15:34 +0400, Maxim D. pisze:

> > I noticed that uploading file (webdav) when client\_body\_temp\_path and  
> > document root are on different partitions sets access and modify time  
> > stamps to 1970-01-01 instead of valid time. It works fine if  
> > client\_body\_temp\_path and document root are on the same partition.  
> > Try the attached patch.  
> > Works great!

## Best regards,

Marcin Engelmann
