Tags:
create new tag
view all tags

Question

Hi. Several of my users have asked for a 'fast attach' functionality. This would be a separate action link on the bottom bar, which would immediately bring up a file browser. Selecting a file and clicking OK, would immediately attach the file to the page, with default settings and no comment. Is there already a plan for anything like this, or is it appropriate to raise a feature request? If neither, any suggestions how I could implement this and share it back?

Environment

TWiki version: TWikiRelease04x00x05
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: RH7.2
Web server: apache 1.3
Perl version: 5.8
Client OS: XP
Web Browser: FF3
Categories: Missing functionality

-- SteveJonesST - 30 Jun 2008

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

While creating a link that pops up the browse dialog is pretty trivial, I suspect after that you 'll need a line or 2 of javascript to auto-trigger the submit on the form.

and here's a quickhack - hiding the textbox and changing the button are css styling issues - it should really be implemented as a tmpl file, that can be used to replace the 'Attach' action.


<div class="patternAttachForm">
<form name="main" enctype="multipart/form-data" action="%SCRIPTURL{upload}%/%BASEWEB%/%BASETOPIC%" method="post">
<input type="hidden" name="filename" value="" /> 
<input type="file" class="twikiInputField" name="filepath" value="" size="70" onChange="this.form.submit()"/>
<input type="hidden" class="twikiInputField" name="filecomment" value="" size="70" />
<input type="hidden" class="twikiCheckbox" id="createlink" name="createlink"  />
<input type="hidden" class="twikiCheckbox" id="hidefile" name="hidefile"  />
</form>
</div><!-- /patternAttachForm-->

even tested it smile - whatever you do, don't upload something by mistake.

NOTE: this example does not degrade nicely - if the browser has javascript off, you get a totally nonfunctional browse, with no submit.

Also, the 'right' way to do this sort of thing would be an small popup giving the user the opportunity to reconsider their choice, and to optionally fill in the details.

-- SvenDowideit - 03 Jul 2008

Change status to:
Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng logo.png r1 manage 4.2 K 2008-07-03 - 05:04 UnknownUser  
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2008-07-03 - SvenDowideit
 
  • 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.