c# - how to delete the downloaded file from server -
I have created an MDB file, and that file has been zipped using asp.net and after this I zip I'm downloading the file.
After downloading the file, do I want to remove the file from the directory using C #?
I tried it now but the button is being downloaded after the click but I want to download it, and after downloading it has been removed from the directory.
is an example:
protected virtual zero downloadNDelete (string sFilePath , String sContentType) {string FileName = Path. GetFileName (sFilePath); Response.Clear (); Response.AddHeader ("content-dispute", "attachment; file name =" + filename); reaction. Contact Type = sContentType; Response.WriteFile (sFilePath); Response.Flush (); This.DeleteFile (sFilePath); Response.End (); }
Comments
Post a Comment