473,666 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extra file extension in Save As dialog

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/archives\Bob\Do cs\file%2Edoc>f ile.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

Jul 23 '05 #1
3 4174
** <ca**********@y ahoo.co.uk>:

HREF=http://host/archives\Bob\Do cs\file%2Edoc>f ile.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
Jul 23 '05 #2
Dan

ca**********@ya hoo.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/archives\Bob\Do cs\file%2Edoc>f ile.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

Jul 23 '05 #3
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

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5828
by: peetm | last post by:
I'd like to write to a log whenever a visitor to my site downloads a file. So, I'd like the link they click to be to a php 'page' that returns the file. Don't know how to do that! Side Question ... Presumably, the dialog that you see when you download a binary (asking for a 'Save As...' file name) is put up by your browser when it 'sees' non-text data coming back as a response? So, how would you download a text file - and cause...
7
16217
by: Martin | last post by:
Again drawing on the groups experience:- 1. For general file opening and file saving, using VB6, are there any issues with using the FileOpen and FileSave Common Dialog Boxes? 2. Is using the FileOpen and FileSave Common Dialog Boxes the best way to go in general? 3. For Most of my projects I will be using the same types of data input form and report output form, as discussed here recently. Also, the files that are
3
2104
by: Ajay | last post by:
hi! How do i create and stream a file? On a webpage i have a link to a file. Next to it i would like link, which, when pressed, runs a script that calculates the signature of the file, pickles the signature to a file and then gives a dialog box asking the user whether they would like to save the file or open it. I have the script to do the signing and pickle the signature into a file, but how do i allow the user to download it?
0
1850
by: abraham | last post by:
Hi In an .aspx codebehind file I retrieve a file from a database and write it to the response buffer, so the browser pops up a 'save file' dialog and the user can save the file to disk. The relevant part of the code (VB) that does this is listed below: Response.Buffer = True Response.Clear()
5
1825
by: Winston | last post by:
Hi Group, in my aspx page there is an Response.Redirect to a file called myfile.csv. The file consists of plain text with comma separated values. I want that the browser opens the save as dialog which it does. So far so good. But the filename, the Internet Explorer suggests is not myfile.csv but myfile.xls. Why does the IE change the file extension? How can I have the save as dialog with the correct suggestion of the filename?
5
3489
by: Patrick | last post by:
Following on from the excellent example at http://www.c-sharpcorner.com/Code/2003/Sept/ExportASPNetDataGridToExcel.asp on how to save a data-grid to excel file, how can I extend the example such that when the user click on the button a popup appear in IE to say "Do you want to save or open file?"
2
7822
by: calebmichaud | last post by:
Hi I am having trouble understanding how to attach a file or files to a record. I want to (in form view0 allow the user to attach one or more than one file to the associated record, and then from then have the link displayed on the form. All the files would be displayed on the computers harddrive (or a network folder) and not in the db itself. I have read and reread http://www.mvps.org/access/api/api0001.htm and understand that i...
3
2463
by: pd | last post by:
guys, in my web app, i have a simple download button and a href which points to a file on my server, when the user clicks on the button or the link, the file should simply be downloaded to the users machine. now this file is a postgres backup file with the .backup extension. now when i use the button, in FF the file download button pops up and i can save the file, i can also right click the href and go save link as. and it works fine.
6
26305
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this one table. My problem is I have two buttons I want to use this code for for the two buttons would put the data in different tables. I have tried copying and changing a few things and nothing will work for me. The code is set up in a module and then I...
0
8444
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8869
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7386
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1775
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.