Edgewall Software
Modify

Opened 10 years ago

Last modified 5 years ago

#11398 new enhancement

Existing attachments can be overwritten without warning when uploading through trac-admin

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: next-major-releases
Component: admin/console Version:
Severity: normal Keywords: attachment bitesized
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

For example, both commands return success:

$ trac-admin $env attachment add wiki:WikiStart file1
$ trac-admin $env attachment add wiki:WikiStart file1

We could perhaps prompt with an "Are you sure you want to overwrite the existing file?".

Attachments (1)

wiki-upload-multiple-times.png (7.7 KB ) - added by walty 9 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by Ryan J Ollos, 10 years ago

Milestone: next-stable-1.0.x1.0.3

comment:2 by Ryan J Ollos, 10 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:3 by Ryan J Ollos, 9 years ago

Milestone: 1.0.3next-stable-1.0.x
Owner: Ryan J Ollos removed
Status: assignednew

comment:4 by Ryan J Ollos, 9 years ago

Keywords: bitesized added
Milestone: next-stable-1.0.xnext-dev-1.1.x

by walty, 9 years ago

comment:5 by walty, 9 years ago

Is it ok if we just add a suffix for the filename, if the file with same name was uploaded before (like the current wiki web page did)?

http://trac.edgewall.org/raw-attachment/ticket/11398/wiki-upload-multiple-times.png

comment:6 by Ryan J Ollos, 9 years ago

Yeah, adding a suffix will probably work well, and consistency is nice.

comment:7 by anonymous, 9 years ago

I just tried, without any patch, running the command twice would automatically add a suffix, with the new filename prompted out.

 trac-admin test attachment add wiki:test2 ~/file_list.txt
04:40:49 Trac[attachment] INFO: New attachment: wiki:test2: file_list.txt by trac
 trac-admin test attachment add wiki:test2 ~/file_list.txt
04:40:55 Trac[attachment] INFO: New attachment: wiki:test2: file_list.2.txt by trac

comment:8 by Ryan J Ollos, 9 years ago

Thank you for investigating. It seems I have been inattentive and created a false report.

I wonder though if we should echo a message, both for TracAdmin and the web ui, when the attachment is auto-renamed.

comment:9 by Ryan J Ollos, 9 years ago

Another consideration: for authenticated users uploading through the web form there is an option Replace existing attachment of the same name. Perhaps we should have an equivalent option from the command line (--overwrite or --force).

comment:10 by Ryan J Ollos, 9 years ago

Milestone: next-dev-1.1.xnext-dev-1.3.x

Narrowing focus for milestone:1.2. Please move ticket to milestone:1.2 if you intend to fix it.

comment:11 by Ryan J Ollos, 5 years ago

Milestone: next-dev-1.3.xnext-dev-1.5.x

Milestone renamed

comment:12 by Ryan J Ollos, 5 years ago

Milestone: next-dev-1.5.xnext-major-releases

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.