473,605 Members | 2,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP: writing a file to response buffer --> IE shows wrong filename

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( )
Response.Conten tType = ContentType
Response.Append Header("Content-Disposition", "attachment ;
filename=" + FileName)
Response.Binary Write(b) ' b is a binary array with the contents
of the file from the db
Response.End()

This all works great, but when showing the save file dialog, the browser
appends [1] to the filename. A file with a zip extension would for example
get a zip[1] extension, which is pretty annoying.

Is there any way to enfore the browser the use the exact filename?
Thanx !

Mike
Nov 17 '05 #1
0 1846

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

Similar topics

3
6786
by: S.W. Rasmussen | last post by:
With the risk of being accused of multi-posting I would like to draw the attention to a serious visual basic/windows issue discussed in the microsoft.public.vb.bugs newsgroup. As pointed out below by Norman Diamond the bug may result in loss of data when saving files with the standard common dialog control. Norman Diamond describes the problem as follows: ---------- In VB6 SP6, VB6 SP5, and possibly others, the common dialog box...
0
2580
by: Copa | last post by:
Hello, I am testing buffering an asp page and Flushing information out to the browser, hence i wrote the code in an asp page that follows this Message Post. The loops are suppose to simulate long search processes with a flush after each search. When i Navigate to the page, redirect to it from another page, or type the URL to this page in the browser, the page is buffered until it reaches the end of the file and is then displayed all at...
7
6354
by: Stephanie | last post by:
If response.buffer is set to true, and no response.flush has been executed, is it accurate to expect that my browser should not be rendering the content which I (well Ok, someone else) is sending in response.write statements? Thanks.
5
8863
by: PJ | last post by:
When streaming a file attachment to the response stream, should I set Response.BufferOutput = False or Response.Buffer = False or both?
2
1644
by: Steven Bazeley | last post by:
I had a download failure problem with a 95MB wmv file. I thought it was my code but I could not find anything wrong. So I tested the download by replacing the 95MB file with a smaller one (20MB). It worked fine. When I contacted my hosting company this is what they told me.
12
7893
by: Jim Rodgers | last post by:
I have a big asp file that has an error under certain conditions -- totally repeatable. However, it only fails when I set response.buffer = True at the top. WHen I set it False in order to debug it, it works every time! I even set it to True, but did a .Flush just before the error, and the error won't happen. It only happens when response.buffer is True and no .response.flush is issued. The error is a string variable turns-up empty...
0
1669
by: ed | last post by:
Hello All. I have seen many posts slightly similar to this question with no answer. Maybe you have some FAQs or something, sorry if I looks repetitive. Here is my Problem: In my application I have a link button inside a module on an IBuySpy Portal to download an excel file. I generate the excel file using the Office 2003
3
2701
by: Jim Rojas | last post by:
I am running IIS v6.1 on a virtual hosting server. Changing the default metabase value is out of the question. Can someone tell me how I can fix this script? Thank you. <% set conn = server.CreateObject("Adodb.connection") conn.open application("connStr") manualID = request.querystring("manualID") if request.Form("manualID") <"" then manualID = request.form("manualID")
2
4215
by: Ron Hinds | last post by:
I'm getting this in an ASP application on IIS6/W2K3. The page in question is trying to return a XML file approximately 45MB in size. Changing this is not an option. Worked fine on IIS5/W2K. I tried Response.Buffer = False, no joy. So I searched on MSDN and found instructions for increasing the AspBufferingLimit property in the metabase. I increased it to 100MB for that web application, stopped and restarted that web application, still same...
0
7934
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
8425
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
8418
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
8288
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
5445
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
3912
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...
0
3958
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2438
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
1
1541
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.