473,803 Members | 4,391 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Files being written to Response.Output Stream hang 25% of the time

I'm writing files directly to Response.Output Stream... setting the
headers like so:

HttpContext.Cur rent.Response.B uffer = false;
HttpContext.Cur rent.Response.C lear();
HttpContext.Cur rent.Response.C ontentType = "binary/octet-
stream";
HttpContext.Cur rent.Response.A ddHeader("conte nt-disposition",
"attachment;fil ename=" + strOutputFilena me);
long lngSize = GetFileSize(str FTPURL, strFileName);
HttpContext.Cur rent.Response.A ddHeader("Conte nt-Length",
lngSize.ToStrin g());
HttpContext.Cur rent.Response.F lush();

BeginDownloadTo Stream(HttpCont ext.Current.Res ponse.OutputStr eam,
strFileName);

About 25% of the time, when the user downloads the file, the file
download box hangs at 99%.

If the user then clicks cancel and tries to download the same file
again, it works every single time.

Problem is not isolated to any particular file... just happens 25% of
the time with random files, and always works the second time around.

No exceptions are being thrown anywhere, so I'm at a loss as to what
is going wrong...

anybody have any ideas?
Dec 5 '07 #1
0 1434

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

Similar topics

1
2953
by: Neil Woodvine | last post by:
***Scenario ... I have a DataList with a hyperlink WebControl in the Item Template. I want to display a 64x64 image in the Hyperlink and set the NavigateURL to the full size image. ***Source Data Item for Databinding is a class with 2 props ... URL Description ***MyMainPage.aspx Page_Load Code ...
6
9816
by: Joseph | last post by:
Hi! I have this webpage that contains some panels and buttons. I also want to output an Image to that same page, but when I save the image to the OutputStream using the Image.Save (Response.OutputStream) method, the panels and buttons get overwritten and only the image appears. Is there a way to preserve the buttons and output the image at the same time? How do I append to the Response.OutputStream? Many thanks!
2
2526
by: Jenny | last post by:
My application generates images dynamic. These images are then used for an image button like in the beneath. Dim ob As Bitmap = New Bitmap(130, 30) Dim banner As Graphics = Graphics.FromImage(ob) Dim tempfilepath As String = System.IO.Path.GetTempPath ob.Save(tempfilepath & "temp.jpg", Imaging.ImageFormat.Jpeg)
2
1881
by: 1 | last post by:
Hi there, A while back I wrote some code using the .Net drawing libraries... this code takes a datatable and generates a pie or bar chart on the fly. The resulting image is returned using response.outputstream. While this is a budget solution it suited the purpose at the time. I now want to reuse this code but because using response.outputstream only allows the resulting image file to be displayed (by itself with no page around it) I...
4
7575
by: Jerry | last post by:
I'm having just a bit of trouble wrapping my brain around the task of working with folders that are above the site's root folder. I let users upload photos (.jpg/.gif files) which can subsequently be viewed on the site's pages. My hosting provider is requiring that any files my Web app writes get written to a folder that is above the app's root folder (for security purposes). When writing the files I understand how to use MapPath to...
0
548
by: srivalli chavali via DotNetMonster.com | last post by:
Hi. I have a PDF file and a MHT file. Following is the code I'm using to read the file and display it INLINE in the browser. PageData is a MemoryStream object that contains the file's actual stream of bytes. ---------------------------- PDF files ---------------------------- Response.ContentType = "application/pdf";
6
730
by: landers | last post by:
Hello All, I am having problems maintaining image quality when drawing text onto an image. I have a reasonable good quality GIF file with a transparent background. Whenever I write text onto it and save it as GIF / JPeg, it does image compression, resulting in a poor quality image. The image is being outputted to an ASPX page using the
7
10500
by: eventuranza | last post by:
For my application, there users can upload and download files to the a webserver. Straightforward enough. However, when they upload a PDF file then try to download it, the file seems to be corrupted. The had not been a problem before but it seems to have been introduced when I refactored the writing to the response to a buffered version to prevent potential OutOfMemoryExceptions (you wouldn't believe the size of some of these...
0
314
by: Chris Ashley | last post by:
I'm writing files directly to Response.OutputStream... setting the headers like so: HttpContext.Current.Response.Buffer = false; HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ContentType = "binary/octet- stream"; HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + strOutputFilename); long lngSize = GetFileSize(strFTPURL, strFileName);
0
9699
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
9562
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
10309
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
10289
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
9119
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
6840
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
5496
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...
2
3795
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2968
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.