RE: Download a file on Django and delete it after return

2017-11-14 Thread James Schneider
On Nov 14, 2017 3:04 PM, "Matthew Pava" wrote: We can download PDFs in our project. We start out generating the PDF on the server. We read the contents of it into a variable to put it into memory. Then we delete the file on the server (it’s still in memory), and the

Re: Download a file on Django and delete it after return

2017-11-14 Thread Ruifeng Hu
Many thanks for your reply ! ! ! On Tuesday, November 14, 2017 at 5:05:20 PM UTC-6, Matthew Pava wrote: > > We can download PDFs in our project. > > We start out generating the PDF on the server. We read the contents of it > into a variable to put it into memory. Then we delete the file on the

RE: Download a file on Django and delete it after return

2017-11-14 Thread Matthew Pava
We can download PDFs in our project. We start out generating the PDF on the server. We read the contents of it into a variable to put it into memory. Then we delete the file on the server (it’s still in memory), and the response is itself the PDF document. I’ll share the last bit of code that

Re: Download a file on Django and delete it after return

2017-11-14 Thread Juan Hernandez
well, we could see the use case to see the correct approach but, what comes to mind is using try/except/finally On Nov 14, 2017 17:56, "Ruifeng Hu" wrote: > Hi All, > > I am now writing a web service which can generate a file and download it > automatically for users,

Download a file on Django and delete it after return

2017-11-14 Thread Ruifeng Hu
Hi All, I am now writing a web service which can generate a file and download it automatically for users, but I want to delete it after the file has been downloaded(after return the HttpResponse). What should I do ? Thank You! Ruifeng Hu -- You received this message because you are