I am using EAServer with EAF framework and JSP client.
After PDF file was created on the server using Amyuni PDF converter, I use redirection in my JSP code to redirect PDF file to the Client browser:
response.sendRedirect(ls_filename).
I tried to delete the file using File Object:
String s = "myfile.pdf";
File f = new File(s);
f.delete();
The problem is, that I can not delete redirected PDF file, because of browser is using it. As my program retrieve hundreds of reports from database, if PDF files will not be removed, they will occupy all memory on the server.
How to resolve this problem with cleanup server from generated PDF files?
Any help appreciate.
Remove PDF file from the server after redirection
Cleanup the server from PDF files
WebPage get file name as parameter when redirect this file to the browser. After redirection user just close the browser and name of file lost. There are hundred of clients and hundreds of different files, and program does not know what previous file was to delete when it get another file from another user.
Hello,
When a client system views a PDF document which was redirect to it from a server, the client system is actually view a copy of the PDF document that has been downloaded on their system. In the situation you can delete the source PDF document on the server.
The situation you are describing can occur if the PDF document redirected to the client is a medium to large PDF which had web optimization enabled when generated. In this scenario the PDF document does not get completely downloaded on the client system and therefore can be deleted when be previewed. As mentioned above this issue can be resolved by disabling web optimization when generating the PDF document.
Hope this helps?
When a client system views a PDF document which was redirect to it from a server, the client system is actually view a copy of the PDF document that has been downloaded on their system. In the situation you can delete the source PDF document on the server.
The situation you are describing can occur if the PDF document redirected to the client is a medium to large PDF which had web optimization enabled when generated. In this scenario the PDF document does not get completely downloaded on the client system and therefore can be deleted when be previewed. As mentioned above this issue can be resolved by disabling web optimization when generating the PDF document.
Hope this helps?