473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

How to get the download completed status?

Hi,

To provide download functionality, I used the below code.

Response.ContentType = "application/x-download";
string strFileName=@"d:\Landscape.jpg";
Response.AddHeader("Content-Disposition", "attachment;
filename=testing.jpeg" );
Response.WriteFile(strFileName);
Response.End();

Once the file is downloaded completely, I would like to delete that
file from server. Is it possible to capture the download completion
stage? Anyone please suggest!
Jun 27 '08 #1
2 988
On 18 Apr, 05:43, Santel <santel_hel...@sify.comwrote:
Hi,

To provide download functionality, I used the below code.

* * * * Response.ContentType = "application/x-download";
* * * * string strFileName=@"d:\Landscape.jpg";
* * * * Response.AddHeader("Content-Disposition", "attachment;
filename=testing.jpeg" *);
* * * * Response.WriteFile(strFileName);
* * * * Response.End();

Once the file is downloaded completely, I would like to delete that
file from server. Is it possible to capture the download completion
stage? Anyone please suggest!
You can't do it with server-side code only. You need to include some
java-script embedded in the .aspx page that will make the browser save
the file locally and then issue a post-back event which will be
detected on the server.

HTH
Jun 27 '08 #2
Thanks for the update. I don't find any option to capture the status
in javascript too. Can you please suggest me to start with?

Jun 27 '08 #3

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

Similar topics

2
by: Keiron Waites | last post by:
Hi, Is there any JavaScript that can force the download of an image or a list of images before the HTML, or any other images are downloaded? This is necessary so I can force the background image...
1
by: alocin | last post by:
in my aspx page's page_load i got: Dim imageData() As Byte=allegato Response.ClearContent() Response.ClearHeaders() Response.AppendHeader("Content-Length", imageData.Length.ToString)...
6
by: Jatin | last post by:
Hey Guys I have a web application that allows users to download files. But the files are not hosted on the webserver. The files are stored on external servers and are referenced by a URL/URI....
0
by: jinnareddy | last post by:
Hi, I'm unable to download a file that is having a 2-byte char in its name (e.g.テ) using force download option. Though, am able to download file names involving ASCII chars. I have tried URL...
1
by: a.r.austin | last post by:
Hello, I am trying to download a few files one after another from a remote server. Problem is that I don't know how to, or if I am able at all, set a time out for download. I don't want to time...
2
by: Dan D | last post by:
I have a large install file (an exe) on my web server that people download and install from. Looking at my log files, I see a lot of people downloading it, but no way to tell for sure if they...
5
by: Dan D | last post by:
I have a large install file (an exe) on my web Apache server that people download and install from. Looking at my log files, I see a lot of people downloading it, but no way to tell for sure if...
2
by: andrew.zahra | last post by:
Is there any way to track completion of a download with PHP? I would like to be able to check if a download completed successfully. My first thought is that I might need to use an applet? Any...
0
by: Tifer | last post by:
Hello, I am building my first .Net Application. The first couple of Publish and Installs I did went fine. But after a couple of builds, I get a modal dialogue box error every time upon trying...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.