| | |
Downloading a File
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
I am developing a site that will allow the users to download files. The files could be of various types - documents, images, applications, etc. I am using a simple link to offer the download
<A HREF="File_To_Download"> Download </A>
If the browser does not support the type of file being downloaded, it simply offers the user an option to the download the file, exactly what I want.
The problem is if the browser can handle the type of file being download (say image files), it opens the file. I would prefer that it offers the user the option to download all different types of files. How do I achieve this ?
I am not sure if this can be done in HTML, or if I need javascript for that. Hence I am posting in this forum. If javascript is required, that is absolutely fine for me.
Thanks
<A HREF="File_To_Download"> Download </A>
If the browser does not support the type of file being downloaded, it simply offers the user an option to the download the file, exactly what I want.
The problem is if the browser can handle the type of file being download (say image files), it opens the file. I would prefer that it offers the user the option to download all different types of files. How do I achieve this ?
I am not sure if this can be done in HTML, or if I need javascript for that. Hence I am posting in this forum. If javascript is required, that is absolutely fine for me.
Thanks
•
•
Join Date: Aug 2008
Posts: 1,160
Reputation:
Solved Threads: 137
just the regular href will choose to view in the browser based upon what the browser can do
here's a link for javascript to force download
http://www.faqts.com/knowledge_base/view.phtml/aid/4906
here's a link for javascript to force download
http://www.faqts.com/knowledge_base/view.phtml/aid/4906
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
Thanks dickersonka for the link. I checked it out, but it doesn't really help me. For one, the execCommand("SaveAs" ..) supposedly works only for IE, so that solution is unacceptable. Changing the filename to remove the extension part - to me sounds like a bad way of doing things, especially since I am not limited to pdf files only. As for C# and .NET , I am using PHP-Linux, so that doesn't help me.
![]() |
Similar Threads
- Downloading a file (ASP.NET)
- downloading a file (C++)
- Downloading a File from Server using JavaScript (JavaScript / DHTML / AJAX)
- Problems downloading Python (Python)
- Howdo I download a .mim file in Macintosh (OS X)
Other Threads in the HTML and CSS Forum
- Previous Thread: negative margins
- Next Thread: Help recreating a design
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






