How to get the download completed status?

S

Santel

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!
 
S

Stan

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
 
S

Santel

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top