Subject: WebDAV Bug?

From: Jim Schatzman <[email-masked]>
Date: Mon, 09 Dec 2013 20:03:26 -0700

Can anyone explain the following behavior and how to fix it?

I am running WebDAV with Apache2 version 2.2.15. 

I take a tgz file and split it. The files are named

test_xaa  test_xab test_xac etc.

I then attempt to download the files through a browser. I have tried several browsers and the result is always the same.

test_xab, test_xac, etc download without difficulty.

However test_xaa gets renamed "test_xaa.tar" and it is, in fact unzipped, sort of. This a problem because it is invalid, since it was not unzipped with the other files attached. It cannot be just re-zipped and then the collection of files unsplit and unzipped, because zipping does not reproduce the original file. There does not seem to be any way to recover.

Equally oddly, if I rename test_xaa to test_xaa.tgz, then it downloads without difficulty. It is not renamed, and it is not unzipped.

I can find no reference to this behavior in online WebDAV manuals.

Thanks!

Jim

---

From: Julian Reschke <[email-masked]>
Date: Wed, 11 Dec 2013 10:15:25 +0100

> I can find no reference to this behavior in online WebDAV manuals.

a) Does this happen with other browsers as well?

b) Do you have an HTTP trace?

Best regards, Julian

---

From: Julian Reschke <[email-masked]>
Date: Wed, 11 Dec 2013 11:13:26 +0100

Instructions are here: http://lists.w3.org/Archives/Public/w3c-dist-auth/

---

From: ken <[email-masked]>
Date: Wed, 11 Dec 2013 19:31:00 -0500

> I can find no reference to this behavior in online WebDAV manuals.

I'm guessing that the problem isn't with apache or webdav, but rather 
wtih the browser.  Check its settings -> applications to see if some app 
is automatically unzipping the first file, test_xaa.

---

From: "Dennis E. Hamilton" <[email-masked]>
Date: Thu, 12 Dec 2013 09:19:17 -0800

There might also be a MIME-type problem, depending on how the original file was split up and the parts renamed.  

I would suggest renaming bits like that to have *.bin names to see if that overcomes it (and assuming the WebDav host has a MIME type rule for *.bin).

---

From: Wim Lewis <[email-masked]>
Date: Mon, 16 Dec 2013 11:52:32 -0800

On 11 Dec 2013, at 4:31 PM, ken wrote:
> [....]
> I'm guessing that the problem isn't with apache or webdav, but rather wtih the browser.  Check its settings -> applications to see if some app is automatically unzipping the first file, test_xaa.

Do you have mod_mime_magic enabled? My guess is that the following is happening:

- Apache cannot assign a MIME-type based on file extension or filesystem metadata, since neither of those exist for this file.
- Apache (via mod_mime_magic) looks at the first few bytes of the file to determine its MIME-type, and discovers that it's tar+gzip or maybe just gzip.
- Client is given this information in the response.
- Client (possibly in concert with the OS) has some behavior to automatically un-gzip downloaded files. (Possibly due to the near-universal confusion between content-encoding and transfer-encoding.)

---

From: Jim Schatzman <[email-masked]>
Date: Mon, 16 Dec 2013 16:51:53 -0700

And that seems to be the answer. I did indeed have mime-magic enabled in apache. I didn't even know that there was such a thing! Thanks to Wim Lewis for the solution.

Jim