473,607 Members | 2,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# WEB: Strange file download problem

1 New Member
I use the following code to create a file for the user to download:
Response.Clear( );
Response.ClearC ontent();
Response.ClearH eaders();
Response.Buffer = true;
Response.Conten tType = "text/ris";
Response.AddHea der("Content-Disposition", "attachment;fil ename=" + sUserID + "-" + DateTime.Now.To FileTime() + ".ris");
Response.Charse t = "UTF-8";
Response.Conten tEncoding = System.Text.Enc oding.UTF8;
Response.Write( sFormatted);
Response.Flush( );
Response.End();

I generate sFormatted in 2 different ways depending on how the user creates the file.

In the first type of file generation, the user provides a comma delimited list of IDs (through a hidden form element) from which a string is created of the articles corresponding to the IDs.

In the second type, the user provides a Group ID (through a hidden form element) from which a set of IDs are obtained from an Object corresponding to that Group ID. A string is then created of the articles corresponding the the set of IDs.

If I pass a set of IDs identical to the set returned by a Group ID, I get an identical set of IDs from both methods, I get an identical string from both methods but only the first method prompts for a download, the second method just reloads the page (a postback is performed to get the hidden element to the server). No exceptions are thrown during or after the generation of the string and both methods go through the same code after the string is generated.

Any ideas on what might be causing the second method to not prompt the download? Session Objects are being called in the second method.
Jan 23 '08 #1
0 820

Sign in to post your reply or Sign up for a free account.

Similar topics

7
4000
by: Kornelius Finkenbein | last post by:
Hello folks! I've got a strange problem with my download-script in conjunction with M$ internet explorer, if the filename I want to link to includes more than one points. In Netscape the problem doesn't exist. For example: input: ... download.php?name=virtualdub_1.4.9.zip
1
3036
by: 3f | last post by:
Hello; We have made a web application that people can download from our web site and installed on: Windows XP Windows 2000 Professional Windows 2003 Server Windows 2000 Server
0
2237
by: Tomas Vera | last post by:
Hello All, I've developed a Commerce Server application and am having deployment problems. The issue is not Commerce Server specific, so I'll ask here, since questions get answered here. The application is developed on a remote machine. My compiler runs locally, but the source files and destination is on the remote machine. The remote machine is running Framework 1.0.3705. This morning I PUP'd the Commerce Server site and deployed it...
14
1879
by: James Wong | last post by:
Hi! everybody, I'm facing a quite strange download problem. I use the following code to download an XML file to client side: With Response ' clear buffer Call .Clear() ' specify the type of the downloadable file
1
3941
by: Daniel Cardoso | last post by:
I don't know what else to try - In my asp.net app, when the file name has Windows-1252 characters (like ã and ç), these characters appear, each one, as two strange characters in the file name label in Internet Explorer File Download Dialog that is shown when I click a link to download the file. The file content is being generated on-the-fly using asp.net and the filename is being passed using a call to Response.AddHeader with the strings...
1
4664
by: Robert | last post by:
I have a server where the main web application (root) is now migrated to 2.0. It's web.config has a line where it adds the system.data.oracleclient in the configuration and assembiles section. There is a sub web application, configured as its own application that is still under 1.1. The 1.1 app won't run because it gets an error shown below. Apparently it is picking up the settings from the root app's web.config (.NET 2.0) and
2
3375
by: Jeff | last post by:
Hey asp.net 2.0 My asp.net 2.0 project has got a assembly load problem: Some of my web.config settings: <membership defaultProvider="AH_MembershipProvider" userIsOnlineTimeWindow="15">
20
4252
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site is structured as an upside-down tree, and (if I remember correctly) never more than 4 levels. The site basically grew (like the creeping black blob) ... all the pages were created in Notepad over the last
8
2987
by: BiT | last post by:
Hello, I'm working right now on project in vb.net 2005 for my company, i need the project to download file from the company web site. In order to get the file i have to give the site address http://www.somthing.com and then send to the server post data like "&d=10202" to get the file. i've search google and newsgroups but I didn't find anything to solve my problem, I found this example...
0
8469
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
8463
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
6803
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
5997
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...
0
5471
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
3953
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
2461
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
1574
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1316
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.