[DUG-TO] Extensions of downloaded files
James An
james at jamesan.ca
Thu Mar 19 13:29:20 EDT 2009
Hallo,
This would be my first post on DUG-TO too! I'm James.
Poking around your work, I eventually stumbled upon the site with the
draft_project_flyer.doc file. You already use clean URLs, so short solution:
set the link href to ".../system/files/draft_project_flyer.doc" (ie. remove
the ?q= part).
Long*er* explanation:
The HTTP header doesn't include the filename, so I suspect that the Internet
browsers are unable to infer a filename out of the URL:
> Internet Explorer 7 names it: draft_project_flyer_doc
Firefox 3 names it: kJaOsJh+.doc.part.doc
> Opera 9 names it: default.doc
> Chrome 1 names it: download.doc
> Safari 3 names it: draft_project_flyer_doc
>
The reason is probably because there is no filename in the URL; The
directory is directly followed by the q parameter.
I think a majority of Drupal installations use clean URLs, but - for those
that don't - you can force a file download with a suggested filename by
setting the HTTP header field, "Content-Disposition", to "attachment;
filename=somefile.ext", where somefile.ext is your filename. I don't know
how this would fit into Drupal though.
James
On Thu, Mar 19, 2009 at 12:34 PM, Andrew Berry <andrewberry at sentex.net>wrote:
> On 19-Mar-09, at 11:57 AM, Alison Benjamin wrote:
>
>> The name of the file, once it's downloaded, changes to something random
>> like: kJaOsJh+.doc.part (on Firefox 3)
>>
>> This sounds like an issue with the download not completing or a bug in
> FF. What happens in other browsers?
>
> In Firefox, the download procedure goes like this:
>
> - The server sends you a file with a MIME type FF sees to be saved.
> - Firefox saves the file with a name like the above during the download.
> This is what it will use if it has to resume the file.
> - When the file is complete (and only then) it renames the file to the
> proper file name.
>
> If the download does successfully complete, it might be worth it to load up
> Firebug and inspect the HTTP headers. It should have a header indicating the
> name of the file being downloaded.
>
> --Andrew
> _______________________________________________
> DUG-TO mailing list
> DUG-TO at lists.openject.com
> http://lists.openject.com/listinfo/dug-to
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openject.com/pipermail/dug-to/attachments/20090319/57c7c52a/attachment.htm>
More information about the DUG-TO
mailing list