How to get the download completed status?

How to get the download completed status?

am 18.04.2008 06:43:21 von santel_helvis

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!

Re: How to get the download completed status?

am 18.04.2008 09:35:41 von Stan

On 18 Apr, 05:43, Santel wrote:
> Hi,
>
> To provide download functionality, I used the below code.
>
> =A0 =A0 =A0 =A0 Response.ContentType =3D "application/x-download";
> =A0 =A0 =A0 =A0 string strFileName=3D@"d:\Landscape.jpg";
> =A0 =A0 =A0 =A0 Response.AddHeader("Content-Disposition", "attachment;
> filename=3Dtesting.jpeg" =A0);
> =A0 =A0 =A0 =A0 Response.WriteFile(strFileName);
> =A0 =A0 =A0 =A0 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

Re: How to get the download completed status?

am 18.04.2008 14:59:35 von santel_helvis

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?