473,721 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help! Can't get "Save target as" to work for some file types

I have an ASP application that uploads a specified file to the server. To retrieve the file, I simply assign the filepath and file to a hyperlink on the page. When you click "Save Target As" for some file types, I get the following error messsage: IE can not download <file> from <server>. IE was not able to open this internet site. The requested site is either unavalable or can not be found. Can anyone tell me how to save a file of any type? It works for MS Word, Excell, text files..

Thanks.
Jul 19 '05 #1
2 2924
What type of file do you have problems with? Are you sure the file exists?

You may get a better answer in a html newsgroup since this does not seem to
be an ASP issue.

Regards
/Hans
Jul 19 '05 #2
Hi Rick,
I have an ASP application that uploads a specified file to the server. To retrieve the file, I simply assign the filepath and file to a hyperlink on the page. When you click "Save Target As" for some file types, I get the following error messsage: IE can not download <file> from <server>. IE was not able to open this internet site. The requested site is either unavalable or can not be found. Can anyone tell me how to save a file of any type? It works for MS Word, Excell, text files...


I'm facing the same problem when I try to download a mdb file. I will start a thread about this issue later today.
Here is the code I have written so far. It doesn't work for mdb files (the results of the download are always corrupted Access databases), but it could work for the type of file you want to download.

<%
Response.Conten tType = "text/plain"
Response.AddHea der "Content-Transfer-Encoding", "binary;"

' Fill the Save As field with the name of the file
Response.AddHea der "Content-Disposition", "attachment ; filename=backup .mdb;"

' Point to the file to be downloaded
thepath = server.mappath( "/") & "\test\backup.m db"

Set fsob = Server.CreateOb ject("Scripting .FileSystemObje ct")
set thefile = fsob.OpenTextFi le(thepath)
response.Binary Write(thefile.R eadAll)

set fsob = Nothing
set thefile = Nothing
%>

Save this code in a Asp page without adding any html tags, and simply call this page to start the download.

I will keep on working on this code , but I'm afraid I will have to use another solution to download my mdb files (renaming them to zip files)

HTH
Yan

Jul 19 '05 #3

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

Similar topics

2
13096
by: gnv | last post by:
Hi all, I am writing a cross-browser(i.e. 6 and netscape 7.1) javascript program to save an XML file to local file system. I have an xml string like below: var xmlStr = "<?xml version="1.0" encoding="UTF-8"?><a>some info</a>"; I want to save this xml file to local file system with JavaScript,
13
1684
by: aatcbbtccctc | last post by:
Sorry if this has already been posted, but a quick google search did not show it in the Access newsgroups. Please read here for an important petition regarding the long-term future of "classic" VBA: http://classicvb.org/petition/ TC
1
1250
by: Zean Smith | last post by:
Is it possible to export the ASP.NET Session object as file/XML for later use? I don't want to use Serialization because my class is pretty complicated and it involves IDictionary which doesn't support Serialization. just looking for easy way to export session.. help pls
21
7177
by: iwdu15 | last post by:
how can i create a code to make my program create an rtf file? heres what i have so far, any help would be appreciated: Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSave.Click Me.SaveFileDialog1.ShowDialog() Me.SaveFileDialog1.CheckFileExists = True Me.SaveFileDialog1.CheckPathExists = True Me.SaveFileDialog1.AddExtension = True Me.SaveFileDialog1.DereferenceLinks = True...
4
6259
by: Jonny | last post by:
Hello Group How do I open a Save File Dialog from an ASPX page behind a browse button? Any help would be fantastic!! I am using ASP.NET 1.1 using VB.NET as the coding language TIA
6
1974
by: amjad | last post by:
Hi i have dataset that i want to save to local disk as xml file. i dont know how to save it to local disk instead of server thanks
5
2718
by: luanhoxung | last post by:
hi all!! i face to a new trouble. in my form, i have a textbox(unbound) that informs details of product when i choose the value of combo box(IDPro). it is ok when i choose the first value of IDPro. but in the second one, the texbox show as same as first. here my code. Private Sub IDPro_AfterUpdate() DETAIL.Value = DLookup("", "TProducts", IDPro = Me.IDPro)
2
7767
by: AccessHunter | last post by:
Hi, In my VBA code I am saving an excel spreadsheet with data from a table. I would like to prompt the Save File or Save As Dialog box with a default File Name, after opening the spreadsheet. Please help me with the code. Thanks
0
947
by: venkat245 | last post by:
Hi, i saved a file specific loaction that file i want to download cureent location saving file is OK but how to download in .net plz help me
1
2504
by: shivishekahr | last post by:
Hi i am havin a prob . i am making a project in which i need to back up and restore the data base from MYSQL for backup i need the savefile dialog to save the file as system date with default ext as .sql and i have made a bat file which executes the mysql dump command and backups the database i also need to knw how to call the batch file from the c# UI by adding it to resources.
0
8730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
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
9215
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...
1
9131
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9064
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8007
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...
1
6669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
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.