dcsimg
Delete temporary file after download from client
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, February 4, 2003 10:22 PM

I've created a temporary file for client to download. There is a servlet to load the temporary file and transfer to the client. After that the temporary file should be deleted. It is fine if the client save the download file. However, if the client choose cancel after download file window prompt, then the temporary cannot be deleted. How can i delete the temporary file no matter the client choose save or cancel? Thanks a lot.

Re: Delete temporary file after download from client

Posted By:   vinay_salehithal  
Posted On:   Wednesday, February 5, 2003 11:19 AM

Try this order of steps:

1. Read the content of the file into yr bytearray

2. Close all file/io connections with that file.

3. set the content-type of the response.

4. do the writing from the bytearray to the client.

5. reset the array, delete the file.
About | Sitemap | Contact