Hi following is the code which sends file to the browser means user can
download file,
but the code generates error message Thread Being Aborted., will any
one put their thoughts
protected void SendFileToBrows er(string strpath)
{
try
{
FileInfo objFileInfo = new FileInfo(strpat h);
Response.Clear( );
Response.Conten tType = "applicatio n/octet-stream";
Response.AddHea der("Content-Disposition", "attachment ;
filename=" + objFileInfo.Nam e);
Response.AddHea der("Content-Length",
objFileInfo.Len gth.ToString()) ;
Response.WriteF ile(objFileInfo .FullName);
Response.End();
}
catch (Exception ex)
{
Response.Write( "");
}
}
Thanks
----
Hitendra Patel 4 6073
try taking out the response.write( "") out of the catch block.
"hi********@gma il.com" wrote: Hi following is the code which sends file to the browser means user can download file, but the code generates error message Thread Being Aborted., will any one put their thoughts
protected void SendFileToBrows er(string strpath) { try { FileInfo objFileInfo = new FileInfo(strpat h); Response.Clear( ); Response.Conten tType = "applicatio n/octet-stream"; Response.AddHea der("Content-Disposition", "attachment ; filename=" + objFileInfo.Nam e); Response.AddHea der("Content-Length", objFileInfo.Len gth.ToString()) ; Response.WriteF ile(objFileInfo .FullName); Response.End(); } catch (Exception ex) { Response.Write( ""); } }
Thanks ---- Hitendra Patel
> Hi following is the code which sends file to the browser means user can download file, but the code generates error message Thread Being Aborted., will any one put their thoughts
protected void SendFileToBrows er(string strpath) { try { FileInfo objFileInfo = new FileInfo(strpat h); Response.Clear( ); Response.Conten tType = "applicatio n/octet-stream"; Response.AddHea der("Content-Disposition", "attachment ; filename=" + objFileInfo.Nam e); Response.AddHea der("Content-Length", objFileInfo.Len gth.ToString()) ; Response.WriteF ile(objFileInfo .FullName); Response.End(); } catch (Exception ex) { Response.Write( ""); } }
Thanks ---- Hitendra Patel
You will get a "tread aborted" exception when you do a
Response.Redire ct from within a try block. Maybe this also happens for
a Response.End.
Try moving that outside of the try/catch.
Hans Kesting This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: vincent wehren |
last post by:
Hi,
Trying to grasp Py_NewInterpreter()in a simple app embedding Python, I was
wondering why the following gives me an error:
int main() {
PyThreadState *tstate;
Py_Initialize();
|
by: Elliot M. Rodriguez |
last post by:
A few of our customers cannot access one of the pages on our vb.net asp.net
site. The problems are limited to only a few people, but these people have
the problem regularly.
The page in question is a simple details page from a link selected from
another page. The details page calls a procedure that calls our database,
returns a recordset, and does some simple binding to some web controls.
This page works for most of our customers. For...
|
by: SKG |
last post by:
I have a web page with customized datagrid and a usercontrol. Sometimes iam
getting
"operation aborted" internet explorer cannot find site <web page name..>
when i click back button i see the page is loaded.
I found my viewstate has lot of junk 3 to 4 pages.
I increased temporary cache,deleted temporary files,cookies,third party
installs of the ie but still problem
persists.
Thanks!!!
|
by: Stephen Miller |
last post by:
I have an ASP.Net application that sends a NetworkStream to a .Net
Service, which has a TcpListener listening on a port for the ASP.Net
client. When it receives a request it creates a new thread with the
AddressOf a class that runs a long data intensive process that can
take between 1-15 minutes and results in the creation of a uniquely
named file.
Meanwhile, I want my ASP.Net application to sit and wait until the
file appears at a...
|
by: Nice |
last post by:
how to comprehend the "Thread Safety"?
| |
by: Aleramo |
last post by:
I hope someone could say me where can i find the meaning of:
gsl: sinint.c:359: ERROR: domain error
Default GSL error handler invoked.
Aborted
or where i can find it.
I don't understand the meaning. I tried to find the error but it seems
inside an "if ()", and it's not a GSL instruction. The program was ok
since i addicted at the function:
|
by: -Lost |
last post by:
This is more of a post to inform, unless of course I am missing
something fundamental, in which case I would appreciate anyone
explaining it.
Based on Mr. Michaux's camelizeStyle function I wrote:
function create_style(style)
{
var p = document.createElement('p');
var t = document.createTextNode('Just something to fill the P.');
|
by: rmgalante |
last post by:
I was wondering if anyone knows whether MS has a fix for the Menu
Control. If the page is loading while you mouse over a menu control
with child menus that pop out, you can generate the following error in
IE.
Internet Explorer cannot open the Internet site...
http://www....
Operation aborted
|
by: gert |
last post by:
is there any way i can make setTimeout work with a private obj ?
function() {
var obj
setTimeout("thread(obj)",0)
}
|
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...
|
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,...
| |
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,...
|
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...
|
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...
|
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();...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |