the problem with any approach is that the http hasn't really an event that signals that the file has been downloaded (and completed) successfully. The usual workaround is to put the location of the file on some list and remove it later by cycling the aforementioned list (say, every day or so).
On Friday, September 4, 2015 at 2:56:53 PM UTC+2, desta wrote: > > Thank you for the reply. I learned something new today! > os.tmpfile() seems very useful but I don't think I can apply it in my > situation. > > The controller creates the file through an API call to a different server > running on the system. As a response, the controller gets the file > location. So it knows where the file is located and streams it to the > client. From my understanding os.tmpfile() would work if I created the file > within the controller. > > Thank you. > > > > On Friday, September 4, 2015 at 3:50:00 PM UTC+3, Yoel Benitez Fonseca > wrote: >> >> if it a temporary file create by os.tmpfile() you don't need to care >> about deleting it, the system will take care of everything for you. >> >> -- >> Yoel >> >> 2015-09-04 8:32 GMT-04:00, desta <deme...@gmail.com>: >> > Hello, >> > >> > When the client clicks on a specific link, a temporary file is created >> by a >> > >> > controller which is then downloaded (using the `response.stream`). I >> want >> > to delete the file after the download finishes. >> > >> > Could you please share any suggestions? >> > >> > Thank you. >> > >> > -- >> > Resources: >> > - http://web2py.com >> > - http://web2py.com/book (Documentation) >> > - http://github.com/web2py/web2py (Source code) >> > - https://code.google.com/p/web2py/issues/list (Report Issues) >> > --- >> > You received this message because you are subscribed to the Google >> Groups >> > "web2py-users" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to web2py+un...@googlegroups.com. >> > For more options, visit https://groups.google.com/d/optout. >> > >> >> >> -- >> Msc. Yoel BenÃtez Fonseca >> Especialista en TI >> http://redevil.cubava.cu/ >> Tel.: (53 32)284701 >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.