I have to implement GEDCOM export in my site.
My .net code created one file at server when export to gedcom clicked.
Then I need to download it to client from server, as well as user should be asked where to save that file, meaning savedialog is required.
After it's downloaded, I want to delete that file from server.
I got one code to transmit file from server to client:
Response.ContentType = "text/xml";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + FileName);
Response.TransmitFile(Server.MapPath("~/" + FileName));
Response.End();
from this LINK
but I am not able to delete the file after this code as Response.End
ends response so whatever code written after that line is not execute.
If I do code to delete file before Response.End();
, then file does not transmitted and I get an error.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…