Hi, I'm going to store some NV params in a file, Z.BIN, which our application can save and load on bootup. I'm using a file instead of the paramter block because it would require less hacking into the code when
services packs etc are released. We can download this file via Firefox 2.0
and save it on the PC. It pops up a "Save as" box when it determines it's
a binary file. I was looking at the Ethereal trace and it doesn't look like the web server sends HTP headers describing the file, so Firefox must determine this by the extension or maybe it looks at the file contents. When we do a software update we can then FTP the paramater file back up to the unit.
When I tested this on IE 6.0 ,it doesn't pop up a "Save as" box, but just dumps this on the screen. I added a binary header to the start of the file,
thinking maybe IE analyzes the file to determine what to do with it, but
it still just dumps it. I then added HTP headers
"Content Type: application/octet-stream\r\nContent-Type: application/force-download\r\n\Content-Length=2048\r\nContent-Transfer-Encoding: binary\r\nContent-Disposition: attachment\r\n\r\n"
to the beginning of the file, but IE still doesn't pop a "Save as" box. I can see the header in Ethereal, so they're getting out on the line.
Is this a IE issue ? I googled around and they suggest adding the above
header to force IE to save the file. IE doesn't seem to have any settings
to tell it what to do with MIME type of application/octet stream.
Anyone have any ideas on this ?
Monitoring an Appache web server and accessing a .bin file on it, I notice
that it sends down an HTTP header file in a sperate packet containing
HTTP/1.1 304 Not Modified
Date: Wed, 24 Oct 2007 20:28:16 GMT
Server: Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4 PHP/5.2.0-8 mod_ssl/2.2.3 OpenSSL/0.9.8c
Connection: Keep-Alive
Keep-Alive: timeout=15, max=84
IE doesn't know what kind of file it is and pops up the "Save As" box.
It seems like IE will interpret a file as text/HTML if it has no header and
the HTTP header must be in a seperate frame from the actual data.
Thanks,
John