List Info

Thread: Download a temp file, then delete it




Download a temp file, then delete it
user name
2006-11-23 03:11:45
Hello,

Is there a way to delete a file after it's been downloaded?
I use the
following code to server a temporary file, but I need to
delete the
file after.

return cherrypy.lib.cptools.serveFile(tempf,
"application/x-download",
"attachment", filename)

Thanks!


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---

Download a temp file, then delete it
user name
2006-11-23 08:18:54
import os

os.remove('path/to/file')


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---

Download a temp file, then delete it
user name
2006-11-23 14:16:36
Well.. I need to delete the file _after_ it has been
downloaded.
How/Where do I know if the file has been completely
downloaded?

On Nov 23, 3:18 am, "David Golightly"
<davig...gmail.com> wrote:
> import os
> 
> os.remove('path/to/file')


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )