Opened 17 years ago
Closed 17 years ago
#2455 closed defect (fixed)
file download and an index check
Reported by: | Brett | Owned by: | Petr Škoda |
---|---|---|---|
Priority: | normal | Component: | TracDownloaderPlugin |
Severity: | normal | Keywords: | download |
Cc: | Trac Release: | 0.11 |
Description
I'm attaching a patch containing the changes I made to the 0.11 version to get it to work for me. There are essentially three parts to the change, with #1 being the important part.
1 - Switch to req.send_file() to take care of sending the file. This provides the user with a regular download status as the content-length is sent in the header rather than doing chunked mode. It also raises RequestDone to stop further processing. In the current version, I was getting an additional HTML error response corrupting all the downloaded files as it was attached to the end of each file I downloaded.
2 - Fix an attribute exception when deleting a download where not all of the fields were set.
3 - The last part is moving the insert_data so that I was getting consistent reports when the user was required a fill out the form for every download. I honestly don't see what the different is :) but it seemed to help. Although, I was also dealing with a browser cache that could have been the problem.
Attachments (1)
Change History (5)
Changed 17 years ago by
Attachment: | tracdownloader.diff added |
---|
comment:1 Changed 17 years ago by
For 3, that should be "when the user was NOT required TO fill out the form".
comment:2 Changed 17 years ago by
Status: | new → assigned |
---|
comment:3 Changed 17 years ago by
One last addition to the patch. I wasn't storing session information for the downloader plugin (downloader_files, form_schema, etc), so I added "req.session.save()" to the end of the save_to_session method which appears to fix that.
comment:4 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Hi!
First of all, thank you very much for your fixes!
I've just commited changes made according to your patch, so it should be working better now. But I didn't include your change number 3 because the use of insert_data() method in the end of serve_file() and every time it's called is not correct when questionnaire is turned on and it DOESN'T solve problem of uncounted downloads of file when you testing it in one browser by just clicking files. The problem is caused by browser cache as you suggested. So when files are downloaded on different computers by different users there shouldn't be this problem with uncounted files.
Thank you again and keep using Downloader. ;o)
Peca
Replying to Brett:
I'm attaching a patch containing the changes I made to the 0.11 version to get it to work for me. There are essentially three parts to the change, with #1 being the important part.
1 - Switch to req.send_file() to take care of sending the file. This provides the user with a regular download status as the content-length is sent in the header rather than doing chunked mode. It also raises RequestDone to stop further processing. In the current version, I was getting an additional HTML error response corrupting all the downloaded files as it was attached to the end of each file I downloaded.
2 - Fix an attribute exception when deleting a download where not all of the fields were set.
3 - The last part is moving the insert_data so that I was getting consistent reports when the user was required a fill out the form for every download. I honestly don't see what the different is :) but it seemed to help. Although, I was also dealing with a browser cache that could have been the problem.
patch file