zip files
Chris Hall (132) 3554 posts |
I am seeing some inconsistency in what happens when I download a zip file from my web site. The files are all uploaded as zip files using !FTPc but on the server they will, of course, simply have the ‘.zip’ filename extension. Windows Firefox – downloads correctly Since Webster can see the file as an ‘Archive’ RISC OS filetype in the save dialogue window, presumably from the file extension ‘.zip’ and the Mimemap file, then RISC OS should be able to cope. Zip files from other web sites, e.g. ArmSort, are downloaded on RISC OS from an identical HTML link of the form:
but do download with the correct filetype with Netsurf. I am now very puzzled. I tend to download my own software either using !Store under RISC OS or using Firefox under Windows (making sure I open the zip archive under RISC OS) so I may not have noticed this before. |
Chris Mahoney (1684) 2165 posts |
Your server is probably serving the file with a MIME type of |
Chris Hall (132) 3554 posts |
So there is nothing I can do about it? Why does it add a MIME type? I haven’t asked it to. Should I upload it with a ,xxx suffix to force the MIME type on RISC OS? Why does Webster see the correct filetype and Netsurf fail to do so? How do I see what MIME type it has decided to add? If I upload the file with a DDC (Archive) file type (vertical zig-zag) it still appears on the ftpc window (after uploading) with an a91 (Zip) filetype (horizontal zig-zag). So it looks like the server is choosing the MIME type itself from the file extension of ‘.zip’. |
Chris Mahoney (1684) 2165 posts |
Sorry for the terseness of my earlier post.
Most server software is configurable. If it’s being hosted by a third-party provider then they may provide a web interface for configuring it.
The HTTP spec requires every file to have one. If the server doesn’t know what to use then it’ll use a default one (usually application/octet-stream).
I’ve never tried that so don’t know whether it’ll work. My gut feeling is that it’s not going to help, but there’s no harm in trying.
I’ve never used Webster but it’s possibly seeing the generic application/octet-stream type and looking up .zip → &A91 in the MimeMap database. I believe Firefox does something similar.
I’m not sure off-hand. Something like Insomnia for Windows can show you, but that’d be overkill for a task like this. |
Steve Fryatt (216) 2105 posts |
Chris’s server is reporting that the files are
so there’s clearly an entry in some of his MimeMap files which matches this, and not one in the mappings on his VRPC system.
Because without one, your browser won’t know what type the file is. Downloaded files don’t need an extension to have a type.
No, because that won’t work. Your webserver won’t know about RISC OS type extensions, and that’s what’s doing this.
Perhaps it makes assumptions based on the filename extension?
Correct. It will have a lookup table for extensions, to map them to MIME types. |
Chris Hall (132) 3554 posts |
My understanding of how FTPc works is that the file type info is removed on upload, leaving just the file extension. Viewing the uploaded file on FTPc uses the Mimemap module and, on my ARMX6, thus shows any .zip file as type a91 and will download it as such. If a download is requested via an anchor link then the server (AIUI) decides on the type of file from its extension and uses its own version of MimeMap to specify a MIME type that is (almost) invisible which should ‘just work’, especially if it is IANA registered. Chris’s server is reporting that the files areContent-Type: application/x-zip-compressed Many thanks for this information. Not quite true, neither matches exactly, but in any case that would not affect what other people are seeing as they cannot know what I have in my MimeMap files, nor from which computer I uploaded the zip file: VRPC.!Boot.Choices.Default.Internet.Files.MimeMap contains application/compress Archive ddc .Z .z "ZIVM " “ZIVM????” application/gzip GZip f89 .gz .gzip .tgz "Gzip " “Gzip????” “ZIVUSITx” application/x-compress Archive ddc application/x-gzip GZip f89 application/zip Archive ddc .zip "ZIP " “ZIP ????” application/zip Archive ddc .arc “BINAarc©” “mArcarc*” application/zip Archive ddc .spk # FIXME: Check for an arj filetype # FIXME: Check for an lha filetype ARMX6.!Boot.Resources.!Internet.files.MimeMap contains application/gzip GZip f89 .gz .gzip .tgz application/zip Zip a91 .zip application/x-bzip2 BZip2 16e .bz2 application/x-compress Archive ddc application/x-gzip GZip f89 application/x-zip Zip a91 application/compress Archive ddc .z .arc .spk .lha .arj .lzh application/bzip2 BZip2 16E .bz2 Adding an entry: |
Gerald Holdsworth (2084) 81 posts |
Have you tried: |
Chris Hall (132) 3554 posts |
No. |