Modify

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)

tracdownloader.diff (2.9 KB) - added by Brett 17 years ago.
patch file

Download all attachments as: .zip

Change History (5)

Changed 17 years ago by Brett

Attachment: tracdownloader.diff added

patch file

comment:1 Changed 17 years ago by Brett

For 3, that should be "when the user was NOT required TO fill out the form".

comment:2 Changed 17 years ago by Petr Škoda

Status: newassigned

comment:3 Changed 17 years ago by anonymous

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 in reply to:  description Changed 17 years ago by Petr Škoda

Resolution: fixed
Status: assignedclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Petr Škoda.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.