Closed Bug 276890 Opened 20 years ago Closed 20 years ago

Download of files corrupted by HTTP headers

Categories

(Toolkit :: Downloads API, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

RESOLVED INVALID

People

(Reporter: davalv, Assigned: bugs)

References

()

Details

(Keywords: dataloss)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; it-IT; rv:1.7.5) Gecko/20041110 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; it-IT; rv:1.7.5) Gecko/20041110 Firefox/1.0

Sometimes when I right click "Save destination as" I get a corrupt copy of the file.
The corruption is due to the HTTP headers.

Reproducible: Sometimes

Steps to Reproduce:
1. Go to http://www.factotus.it/it/content/DisplayPopup.jhtml?documentId=I5998
2. Right click on "Scarica il modulo di autocertificazione di abbonato RAI" and
click "Save desinatio as" to save the PDF file
http://www.factotus.it/it/documenti/autocertificazione.pdf
3. Sometimes the PDF content is corrupted by the HTTP headers.
Actual Results:  
Sometimes I am unable to open downloaded files (movies, PDF, etc.) because the
HTTP headers.
For example:

ac8
HTTP/1.1 200 OK
Date: Mon, 03 Jan 2005 18:50:36 GMT
Server: Apache/1.3.19 (Unix) PHP/4.2.2 mod_ssl/2.8.3 OpenSSL/0.9.6b
Last-Modified: Fri, 17 Dec 2004 15:51:41 GMT
ETag: "e8602-3118-41c3008d"
Accept-Ranges: bytes
Content-Length: 12568
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Content-Type: application/pdf

%PDF-1.3
%äãÏÒ
5 0 obj
<</Length 6 0 R
/Filter/FlateDecode
>>
stream
xœ+ä2T0 BC ´01THÎå2Ð30µ´´ë"s€r…på–F–
&æÆ AC#=Sˆ0œ hendstream
endobj
6 0 obj
60
endobj
7 0 obj
<</Type/XObject
/Subtype/Image
/Width 170
/Height 52
/BitsPerComponent 8
/ColorSpace/DeviceRGB
/Filter[/FlateDecode]
/Length 8 0 R
>>
stream
xœíœÁuó8„Kq;.Ä=¤ÝrLºæœ»pn ü7.VßrÞ¤9É®½‰æà'KEq@
A•òüùó§{¼cÇŽŸËåòôôt:öÿK ¢§i:Ã0‡8X)?Žc!
Q9ŸÏ©ž›ðþþ5Ä£Cðº5P
®¦óq&.µÇï3>¬!žÕ>Ñïõ:Û¦z%©%/Ë |÷Æ8hŸ»òúKm؈?oooÁ{0´®@<ë`ˆ»¼’›÷†ççgÍ臗—¿*IÄ™
¢ÌÇQ’óãŽãRÜåàÞ"þúã8£{ý8à-áqQy¼oÓŽ××Wnz 
Þ˜¶+ô:e•qÆëçÍ£Ù^ÕFDgF
ÓŒ8ŽÄß
ôuªE?Ä^ƒhdÜňÄq+¥+OfÇƒèÆøû<1†¸¨Ÿ± I è•ã¡PÌÎ>24xY1žØP—}¨‰Ç¡è|‚èd-s//źcß)£þ¨Š«¼QÜHµ‰}¤ý+ìÓÛ4Œ€h@<­¿Œî(iáqH€©hvoQDôŒ÷¯ÉPz™‘”
ô¥Þ£<½ûm·ÀK¼ciØçí¢ñ-ûôvà›<EäRñãöõi5¤2þÐÄ~¼)Òþ9ö©
1Zã7*d Ã)ìSgsÄ€«D”Ÿ»â˜YC‚ä—ec€·kÛÌø‚¦¶Ó¼£49ƒ
”†ý¤‹¢L{•ãx/×ê^†pªe‚¦I!ém®¶*Q¯ß*vO–SŽiÒ­ìÓæxÍófp:$NB4šœó(”<
ˆ2(:º+Σ£˜Ðñ5£–ZÒíR¡K\zSP’ÑÄ ~×Ùo¯¢ó©¤Ë>ãw¥W) 
«U8>£	*æm«-Æ>•Sx;û²Ç
=Z‚âb,óî0ˆyƒ}nDPôOÔpš’€ŠÀËÀG`§Û$éŸîÕí컌1ÜÊ>L±.ûíÌž
ýS®%!H™³ïºÂ›šØ‡)M|ÛÙ§<£X#18(€ÞÑÌQ	¤ÇUÎÄo4€)  7ÜtÖm3C¸,LµåZfP>iîFmgŸ
±Êû]AM~¥¤KÛ÷•‰«3nµv¥‹!©Hç§æmdŸ‰N¿©{™å1ŸG²íu#Ž€Û„î¢E£UÜ+;¡ÛªVú0t9W‡s‹„yön¹maŸòêù.ûÉ£TIã»®Ðä8¨~·úZ.’a0\{ ·Îûxô²Bý(f¨jØêíP°ˆ³À¬qªà^Q@=Ñ6ôj×â-×>4°DEì`dâ\¸<p5uš{mÙ÷]öK%—Y/Ê£sº“{’éØêÒ]ÉãcòUýz5ØOcáVƒ6F0øc£
4Ìe¼aÞ+üËÔûHˆ¬D@†%óÂzÐ#m¨ˆc/Œ	¡«Düõ[r[cxý¤—–Ø/Mè©•ÒÐöF&t£=’
Ä
jóìÐx@Ÿ`: ’0ƒ}‡'…5Æ5äÕ<BCÑ)yƒy!J~ت²öÝ8ç½Ð#Ú0õ¿F+Æ#=ˆ‘ƒÇa¶èžÀ>ò@¨«O»BA‡bmëGŒe"6ί,¢'W I…‘…
UóÒt¿ã¾`J“w!Œh§[k=¢^g(ï´¦¾´
F÷~×W <‹®Žpý0–0Y£p¬Ðy…ød!K˜"г»§
< *Ýs÷àŒ{¢Þ,r“@~ì‡lh*¹÷KïøRìsÙù¡®“m/ãõ` &nç.9˜‚ZùÅ1\2 ÜnS¦¨JÊϯTõ{
§¿ž_¢»¢^“¾|£Ïqä™)d-0#`="L.O·=­#ì‘ð®§Œ!16YëçWªú
 KQÅxZÚƒA49J Ò
¾),À°RœŸÚp‡ºZĘbNÁ–`
Fýœ€Ábqi²|•Ò[ZþhÏwo¶C~0°îЮÄaX’ÃlƒnYdÚ•Àä*‚¡’ÀÂZ#°ÌÁ¢¨ŸQÏ¥õôÁÈvö¿*'ËÖæ8'¦;õβ]@1ô!‹}XøšCe
*Ú3ÔØ,F`YûÀc³;ûß…òD%ÃŽ`ÿR&w3,…ßq<s•)@*‚ä@–Iiý¾%ögµÎ¡Ì½[Ùw¿u©ØëS¬ñ5˜pP†Í†–æ´l'À ÌE•G±`
bO"N„•.5
,նľ·PVŽO³     ................... etc. etc.

Expected Results:  
Downloaded files have to be not corrupted.
Severity: major → critical
Keywords: dataloss
This is sort of a garbage in/garbage out thing.  If we get binary data that's
corrupted, we have no effective way of knowing that, since various file formats
have different data structures.

If this is what we get from the server, the server needs to fix their download
script.  There's no way we can uncorrupt corrupt tranmissions.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Status: RESOLVED → VERIFIED
The problem is that with MS Explorer the download is never corrupted. Why?
Status: VERIFIED → UNCONFIRMED
Resolution: INVALID → ---
I have the same problem, very time I downloaded a file by right mouse click
"Save Link as.." the file gehts damaged. When I open the file (for example an
mpg movie) with a text editor, the file starts with an HTTP Header. The actual
data follows the header but is separated by different numbers. So it's no
surprise that the file doesn't work. 

Why does Firefox put the http header at the beginning of the file? Downloading
the file with IE doesn't damage the file.

I have the same header corruption occuring when I download the file from FireFox
while ZoneAlarm Pro is running (tried both ZA 5.1.033 and 5.5.062). Either file
downloads completely, but is corrupted, or the download doesn't complete at all.

No ZoneAlarm -- no problem. 

IE6 has no such difficulty.
I sniff HTTP requests and responses to try to understand why I've got this 
problem.

When clicking "Save link as...", Moz sends an HTTP HEAD request, which is 
incorrectly handled by the HTTP server (in our case, IIS6+ISAPI dll). Our 
application sends the headers and the file content back. It's our mistake, 
since we should not send content on HEAD requests.

Once the HEAD response is received, Mozilla sends the GET request to get the 
file. However, the content saves on disk contains both the content from the 
incorrect HEAD response, as well as the headers and the content received from 
the GET response.

Once again, its our application (eg. bad HTTP servers or upload scripts) which 
poorly handles HEAD requests, but maybe Mozilla should take care of this case 
and try not to mix up both responses.

IE never sends HEAD requests, so we never had problems with it.
Mike Connor is this still Invalid?
Yes, still invalid.  If the server can't cope with a valid HTTP request and
sends bad data, we'll get bad data and we can't control that.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → INVALID
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.