Bug 55506

Summary: BUGZILLA: attachments damaged during upload with auto-detect content type on
Product: freedesktop.org Reporter: Rainer Bielefeld Retired <LibreOffice>
Component: BugzillaAssignee: fd.o Admin Massive <sitewranglers>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: detective.conan.1412, LibreOffice, omcfadde, website
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Sample Document 1
attachment test: plaintext 10 bytes
attachment test: plaintext 10 bytes, auto-detect OFF
png icon - firefox from osx - autodetect
png icon - firefox from osx - autodetect - apache restarted just incase python caching in place

Description Rainer Bielefeld Retired 2012-10-01 17:38:01 UTC
I found this problem during my research for "Bug 55430 - EDITING: Single mouse click selection of element completely drawn in front of selected filled area impossible"

Steps how to reproduce:
1. Download <http://www.bielefeldundbuss.de/LibO/55430/newsample.odg>
   and
   <https://issues.apache.org/ooo/attachment.cgi?id=79703>
2. Check size of both documents, should be 11805 bytes
3. Upload one of the documents here (I did with SeaMonkey/2.12.1) as
   attachment
4 [review]. Download document again and save. If you suffer from the same problem as I with
   attachment 67868 [details],  attachment 67936 [details], size now should be 11686 bytes, and LibO 
   will not open the documents (form WIN files explorer or LibO File menu), 
   but give Error Message "General Error"

Works fine with upload / download to AOOo Bugzilla (see link above), so I think
it might be something with Bugzilla.

Can you please check upload / download with a document of your own to confirm this issue before we change Component to FDO Bugzilla?
Comment 1 Rainer Bielefeld Retired 2012-10-01 17:44:00 UTC
Created attachment 67938 [details]
Sample Document 1

I upload this document with auto-detect content detection, using Seamonkey.
Comment 2 Rainer Bielefeld Retired 2012-10-01 17:49:40 UTC
Oops, some mess in step 4, please only regard att. with complete No.!

I was able to reproduce with  "Sample Document 1", original document has 9.888 bytes, the one I got back from Bugzilla has 9769 Bytes and can not be opened with LibO or AOOo (Text import filter appears).
Comment 3 Rainer Bielefeld Retired 2012-10-02 04:29:39 UTC
I see the same problem with Sample Document attachment 67958 [details] for Bug 55522, Changed size when I have downloaded the document again, Applications can not open downloaded att. document.
Comment 4 Korrawit Pruegsanusak 2012-10-02 04:40:06 UTC
Yesterday I also suffered from this problem from Firefox 15.0.1 on Windows 7, so promote this bug as NEW.

It's in bug 55462. I tried to upload a screenshot there, *using AUTO-DETECT content type*. It was auto-detected correctly as image/png. But when I tried to open it in Firefox, it said the image is broken or somesuch (I can't remember it exactly).

Uploading again (see bug 55462 comment 2) using auto-detect also gave same result. And again changing from .png to .jpg, with auto-detect; it correctly detected as image/jpeg, but also failed to display image.

I downloaded all three uploaded files and found that, as stated in bug 55462 comment 4:
> Bugzilla cut off first 4 bytes from .png image, and first 3 bytes from .jpg image.

So, I tried again with Google Chrome on Windows XP, *without auto-detect content type*, and it worked.


In conclusion, two possible reasons for this:
* It's firefox (and firefox family) bug
* It's bugzilla auto-detection bug

I will try to differentiate in next comment ...
Comment 5 Korrawit Pruegsanusak 2012-10-02 04:42:47 UTC
(In reply to comment #4)
> Yesterday I also suffered from this problem from Firefox 15.0.1 on Windows
> 7, so promote this bug as NEW.

Aw, mid-air collision with Rainer ;) And after reading Rainer's comment, I decided to leave it as-is.

> In conclusion, two possible reasons for this:
> * It's firefox (and firefox family) bug
> * It's bugzilla auto-detection bug

Oh, yes, thanks Rainer! The third reason might be a downloading bug.
Comment 6 Korrawit Pruegsanusak 2012-10-02 04:46:46 UTC
Created attachment 67964 [details]
attachment test: plaintext 10 bytes

This is an attachment upload testing. It is a plain text, containing 10 numeric characters, "0123456789", thus size = 10 bytes.

I upload this from Google Chrome on Windows XP, turning auto-detect ON.
Comment 7 Korrawit Pruegsanusak 2012-10-02 04:50:17 UTC
Created attachment 67965 [details]
attachment test: plaintext 10 bytes, auto-detect OFF

Aha, my attachment was deleted!

Try again with same file, turning auto-detect OFF and select "plain text (text/plain)" from a dropdown list, which is default option, instead.

From Google Chrome on Windows XP
Comment 8 Korrawit Pruegsanusak 2012-10-02 04:52:55 UTC
So, from comment 6-7, I would like to conclude that this is Bugzilla's auto-detect bug, and not others as suggested. Really promote this bug as NEW.
Comment 9 Korrawit Pruegsanusak 2012-10-02 05:06:03 UTC
Edit subject accordingly
Comment 10 Tollef Fog Heen 2012-10-02 05:08:20 UTC

*** This bug has been marked as a duplicate of bug 55270 ***
Comment 11 Tollef Fog Heen 2012-10-02 05:11:34 UTC
Ooops, a bit quick there, this doesn't appear to be a dupe after all.
Comment 12 Benjamin Close 2012-10-02 11:34:41 UTC
*** Bug 55531 has been marked as a duplicate of this bug. ***
Comment 13 Benjamin Close 2012-10-02 11:49:47 UTC
My guess is this and bug 55270 are certainly related
Comment 14 Benjamin Close 2012-10-02 11:58:21 UTC
Created attachment 67986 [details]
png icon - firefox from osx - autodetect

png icon - firefox from osx - autodetect
typesniffing plugin for bugzilla removed
Comment 15 Benjamin Close 2012-10-02 12:02:59 UTC
Created attachment 67987 [details]
png icon - firefox from osx - autodetect  - apache restarted just incase python caching in place

png icon - firefox from osx - autodetect  - apache restarted just incase python caching in place
Comment 16 Benjamin Close 2012-10-02 12:04:08 UTC
Test successful. Issue caused by typesniffing bugzilla extension.
Bug closed

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.