Click here to get back home

Extra file extension in Save As dialog

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Extra file extension in Save As dialog cathywigzell 02-23-2005
Posted by cathywigzell on February 23, 2005, 4:00 am
Please log in for more thread options


I have a web page which allows a user to download a file directly to
their computer, using IE. I present a file name in a table and the user
can then right click on the file name to get a popup menu with the
option 'Save Target As...'. Selecting that option results in the Save
As dialog.

However, if the filename has a reconginsed extension, e.g. .doc, then
the Save As dialog adds another extension, so the file name in the Save
As dialog ends up as 'file.doc.doc'. This is not the desired effect!
The 'Save as type' field on the dialog is automatically set to
Microsoft Word Document, so the client browser is recognising the .doc
extension.

The HTML for the table data item is as follows...

<TD><A title="Name of file to transfer"
HREF=http://host/archivesBobDocsfile%2Edoc>file.doc</TD>

The file downloads OK but is given the name file.doc.doc. How can I get
rid of the extra .doc extension?

Many thanks for your help,
Cathy



Posted by Dan on February 23, 2005, 2:42 pm
Please log in for more thread options



cathywigzell@yahoo.co.uk wrote:
> I have a web page which allows a user to download a file directly to
> their computer, using IE.

And what if they're using a superior browser instead?

> <TD><A title="Name of file to transfer"
> HREF=http://host/archivesBobDocsfile%2Edoc>file.doc</TD>

Several syntax errors here. The A element is unclosed, the HREF
attribute needs to be enclosed in quotes, forward slashes should be
used instead of backslashes, and the dot in the filename shouldn't be
encoded as %2E. That last one, the unnecessary encoding of the dot, is
probably what's confusing the browser with regard to file naming.

--
Dan



Posted by cathywigzell on February 24, 2005, 4:00 am
Please log in for more thread options


Thanks for all you suggestions - it now works perfectly. This is what
I've implemented...

<TD><A title="Name of file to transfer"
HREF="http://host/archives/Bob/Docs/file.doc">file.doc</A></TD>

Cathy



Posted by Christoph Paeper on February 23, 2005, 4:54 pm
Please log in for more thread options


>
> HREF=http://host/archivesBobDocsfile%2Edoc>file.doc</TD>
>
> The file downloads OK but is given the name file.doc.doc. How can I get
> rid of the extra .doc extension?

Don't encode the dot. Also close your 'a' element instance and don't use
backslahes where slashes belong.

--
"It is not worth an intelligent man's time to be in the majority.
By definition, there are already enough people to do that."

G. H. Hardy


Similar ThreadsPosted
invoking ie/windows file save dialog July 15, 2004, 4:47 pm
Mp3 to open save as dialog box December 16, 2005, 10:30 am
Is a "ZIP" extension the ONLY way to force a "SAVE AS" for your PDF? August 10, 2004, 1:43 pm
Browse for file dialog box - modification needed August 30, 2006, 12:45 pm
OK Button in Dialog box greyed out when linking to Word file January 8, 2008, 3:40 pm
Why can't I save this page as a file and where's the source html? June 22, 2005, 2:08 am
changing file name in "Save as" option for html files October 26, 2005, 3:43 am
Extra Space in IE - The Sequel June 20, 2006, 8:54 pm
Odd occurence with extra variables in GET form July 16, 2004, 12:28 pm
Div in Table Cell extra space July 29, 2004, 2:26 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap