create new tag
, view all tags

Feature Proposals » Ability to save attachments with modified names


Current State: Developer: Reason: Date: Concerns By: Bug Tracking: Proposed For:
AcceptedProposal DebabrataDas AcceptedBy7DayFeedbackPeriod 2011-09-08   TWikibug:Item6805 KampalaRelease

Edit Form

DateOfCommitment:   Format: YYYY-MM-DD


Current behavior incompatible with TWiki 4. Extends current behavior without compromising any current usage of the Upload script

Description and Documentation

See Item6805 for detail.

Inroducing a few new input fields(filename, filename1... filename9) for user specified attachment names. If the fields are empty or are not specified then behavior remains unchanged.

Your form should be defined similar to following:

<form enctype="multipart/form-data" action="%SCRIPTURLPATH{upload}%/%WEB%/%TOPIC%" method="post">
<input type="text" name="filename" value="" size="70" />
<input type="text" name="filename1" value="" size="70" />
<input type="text" name="filename2" value="" size="70" />
<input type="text" name="filename3" value="" size="70" />
<input type="file" name="filepath" value="" size="70" />
<input type="file" name="filepath1" value="" size="70" />
<input type="file" name="filepath2" value="" size="70" />
<input type="file" name="filepath3" value="" size="70" />
<input type="submit" value='Upload file' />


<form enctype="multipart/form-data" name="main" enctype="multipart/form-data" action="%SCRIPTURL{"upload"}%/%WEB%/%URLPARAM{"page"}%" method="post">
<input type="hidden" name="filename" value="newName.txt"/>
<input type="hidden" name="skin" value="%URLPARAM{skin}%" />
| *Path* | <input type="file" name="filepath" value="" size="70"/> |
<input type="hidden" name="filecomment" value="SomeComment"/>
<input type="hidden" name="createlink" />
<input type="hidden" name="hidefile" />
<br /><input type="submit" value=" Upload File" />



Modified script file attached.

  • Upload.pm.txt: Modified Upload script to accept user specified attachment names
-- Contributors: DebabrataDas - 2011-09-08


I am all for adding the new feature. Spec is clear as for form field names (such filename2) and backend processing by the upload script. That way, custom file upload forms can be created to take advantage of this feature.

However, I am not sure if the filename input fields should be shown in the standard attach screen, unless we find a very intuitive and non-intrusive way to do that. Example attach screen as it is now:

  • Sample attach screen with three files ready for upload:
Not sure how / where the file name input fields would go. May be show input fields next to the red Remove button, small icon instead of the read only text? Show it pre-filled with actual name?

As for contribution, it is better to attach a diff instead of the .pm file so that it is easy to spot what the changes are.

-- PeterThoeny - 2011-09-08

Here is a non-functioning mockup of an attach screen that allows rename of attachment on upload.

– Attach new file

File Rename on upload Comment - so other people know what it is.
Remove button, small menu.png
Remove button, small sandbox-cimbal.png
Remove button, small sandbox-twiki.png
Attach file
Upload up to 25000 KB. Attach up to 10 files at a time.

– Properties

Create a link to the attached file Images will be displayed, for other attachments a link will be created.
Do not show attachment in table Attachments will not be shown in topic view page.

I do not like/favor it, it is too busy and distracting. I suggest to add the feature in the backend and document it, but to leave the attach screen as it is now.

-- PeterThoeny - 2011-09-08

I agree. There is no urgent reason to change the attach screen. Our immediate requirement is that we allow users to upload documents using our application, and we need to ensure that different users can upload files with identical names, but associated with different objects, and the new attachment does not overwrite the earlier one.

-- DipuDeshmukh - 2011-09-09

Here is the patch file that contains only the differences between the original and the modified Upload.pm script.

-- DebabrataDas - 2011-09-09

Dipu, we are in agreement.

Debabrata, the patch looks good. I suggest to ask for SVN access so that you can checkin directly. See GettingInvolved, ReadmeFirst, SoYouWantToBeATWikiDeveloper, and then RequestAccessToSubversion.

Wait for the AcceptedBy7DayFeedbackPeriod before checkin. See TWikiReleaseManagementProcess,

-- PeterThoeny - 2011-09-09

I think this is a small & safe enough enhancement that can go into the next TWiki-5.1 patch release. George?

-- PeterThoeny - 2011-09-10

What a nice usability feature. I'd favor including the rename on upload option on the standard attach screen. To keep the current clean attach look and feel, how about a simple column labeled "rename?" with a checkbox aligned with the red Remove button, small icon? When checked, the row of the file expands to includes the columns as shown in the mockup.

-- GeorgeTrubisky - 2011-09-14

May be track the rename in standard attach screen in a separate proposal, and keep this one just for the backend?

I can commit to defining the UI with usability in mind, but I do not have the time to code the CSS/JavaScript.

-- PeterThoeny - 2011-09-14

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatpatch Upload.patch r1 manage 1.1 K 2011-09-09 - 12:10 DebabrataDas  
Texttxt Upload.pm.txt r1 manage 13.8 K 2011-09-08 - 10:40 DebabrataDas Modified Upload script to accept user specified attachment names
Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r12 - 2013-10-11 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.