Open KenT2 opened 8 years ago
Hi Ken, Interesting request. I'm not sure it is feasible, I've to study a solution about this.
I thought something like this:
<def download(self): f.open(self._filename, 'r+b') if exception: callback fail content = f.read() f.close() headers = {'Content-type': 'application/octet-stream', 'Content-Disposition': 'attachment; filename=%s' % os.path.basename(self._filename)} callback finished return [content, headers]>
After f.close self._filename can be safely deleted as the content will as a minimum have been written into a buffer. It may not however have been downloaded and this download could fail. I am not worried about this as the user will be able to detect that the download has failed. The important thing is to have a callback when the remi knows its safe for the App to continue.
I know its not that simple as callback finished and return bothe need to be executed
Hi Ken,
I thought about the same solution. I will implement this soon. Thank you.
Hi Davide I'm back, updating Pi Presents to your latest and greatest. Lots of good things have been happening while I have been sunning myself ;-} Any progress with this one likely to happen in the near future Ken
@KenT2 Still no updates about this. Excuse me. Do you need a quick fix for your project?
Hi Davide No its not urgent. I have a workaround. Looking at the code again the filedownloader widget is in a dialog and I can use the OK button to delete the zip files.
The FileDownloader should have on_finished and on_fail callbacks.
The download could fail. Also an on_finished callback would allow deletion of temporary files such as zip archives.