Home » U++ Library support » Skylark » delete the file from the skylark/server after download (how to know if the file was sent "by the server" and delete it!)
delete the file from the skylark/server after download [message #58861] |
Sun, 18 September 2022 23:57 |
BetoValle
Messages: 204 Registered: September 2020 Location: Brasil Valinhos SP
|
Experienced Member |
|
|
Hi,
is there any method in skylark that runs e.g. delete the file after the download has finished?
//file download.icpp --> this operation works fine!
SKYLARK(dwn, "download:POST")
{
String f="C:\\Users\\my\\Downloads\\rProdx.pdf";
FileIn fi(f);
String fn=GetFileNamePos(f);
//--> applicaton/pdf it's already set in my ajax!
String x= "attachment; filename=\"" + fn +"\"";
ttp.SetHeader("Content-Disposition", "attachment;filename=\"" + fn +"\"" ).ContentType("application/pdf") << LoadFile(f);
}
something like this ...
SKYLARK(Adwn, "Afterdownload")
{
.....
.....
String fn="c:\\temp\\test.pdf";
FindFile f(fn);
if(f.IsFile()){
bool b= DeleteFile(fn);
LOG( "file deleted: " << b << EOL );
}else{
LOG( "file not found! " << EOL );
}
}
Thanks!
|
|
|
Goto Forum:
Current Time: Sat Apr 19 04:19:08 CEST 2025
Total time taken to generate the page: 0.03241 seconds
|