| |

VerySource

 Forgot password?
 Register
Search
View: 825|Reply: 8

Problems generating temporary files !!!

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-11 12:00:02
| Show all posts |Read mode
I am now dynamically generated html file, I want to open it after generating it, and then delete that temporary file

The problem now is that the code is executed too fast, the page I opened was just deleted, so
Prompt "This page does not exist", how to solve this problem?
Reply

Use magic Report

0

Threads

119

Posts

67.00

Credits

Newbie

Rank: 1

Credits
67.00

 China

Post time: 2020-1-15 15:09:01
| Show all posts
Temporary files are placed in the system's Temp! This way the system guarantees to delete it!
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-15 16:09:01
| Show all posts
Put it in the system's Temp, how does the system delete it? Is there any code?
Reply

Use magic Report

0

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-15 22:45:01
| Show all posts
Why no one answered, even if it is placed in the system temp, how to delete it
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-16 10:27:01
| Show all posts
Doesn't work with file.delete?
Reply

Use magic Report

0

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-18 05:18:01
| Show all posts
The key is I still have to open
Response.Write ("<script> window.open ('./ Temp /" + stime + "', 'temp', 'width = 712, height = 377'); </ script>");

//if(System.IO.File.Exists(Server.MapPath("./Temp/"+stime+ "")))
// {
//System.IO.File.Delete(Server.MapPath("./Temp/"+stime+ ""));
//}
If I remove the comment, I open it and say that the page does not exist.
Reply

Use magic Report

0

Threads

3

Posts

1.00

Credits

Newbie

Rank: 1

Credits
1.00

 China

Post time: 2020-1-18 09:07:30
| Show all posts
You have deleted the file before returning the response to the browser. It definitely won't work. In the script, call back the server side to notify that the file has been opened, and then the server can delete it after receiving the notification.
Reply

Use magic Report

0

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-18 09:09:02
| Show all posts
Does anyone know, thank you, have all the masters gone to rest?
Reply

Use magic Report

0

Threads

29

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 China

Post time: 2020-1-18 20:27:01
| Show all posts
Why did you delete it so fast? You deleted it on the server side, of course, you ca n’t see it on the browser client. Can you add a button in it, and if you are satisfied, you will generate html and delete it if you are not satisfied. Ha ha
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list