• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item6832: Can't upload attachments in Chrome

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine Attachments Normal Closed   patch 5.1.1

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


I'm am unable to upload attachments in the TWiki when I use the Google Chrome web browser.

When I go to attach a file to a TWiki page, no matter which file I choose to upload, the TWiki concatenates the file's directory path to "C:/fakepath/..."

I'm using Google Chrome version 16.0.912.75m with Windows XP SP3.

-- TWiki:Main/LisaTanguay - 2012-01-13

A quick Google search shows related issues with HTML/HTML5 compatibility:

Some research is needed.

-- TWiki:Main.PeterThoeny - 2012-01-13

I do not have the environment handy to test, could you apply this patch of twiki/templates/attach.pattern.tmpl to verify? Patched file attach.pattern.tmpl is also attached.

--- attach.pattern.tmpl.save1   2010-06-14 23:41:41.000000000 -0700
+++ attach.pattern.tmpl   2012-01-13 15:06:17.000000000 -0800
@@ -61,7 +61,7 @@
   var fileNo = $('input.upload').size();
   $(obj).parent().prepend('<input type="file" class="upload" name="filepath'+fileNo+'" value="" size="50" onchange="doIt(this, '+fm+');" />');
-  var v = obj.value;
+  var v = obj.value.replace( /.*[\/\\]/, "" );
   if(v != '') {
     $("div#files_list").append('<div>'+'<input type="image" src="%ICONURL{remove}%" width="12" height="12" border="0"  alt="Remove file" title="Remove file" value="" style="margin:-2px 0px 0px 0px; border:none; padding:0px; width:12px; height:12px; background-color:transparent;" /> '+v+'</div>').find("input").click(

-- TWiki:Main.PeterThoeny - 2012-01-13

Actually, before you try attach.pattern.tmpl please patch twiki/lib/TWiki/UI/Upload.pm as follows to test the cleanup of file path on the server side:

--- lib/TWiki/UI/Upload.pm   (revision 22486)
+++ lib/TWiki/UI/Upload.pm   (working copy)
@@ -227,6 +227,7 @@
     # below - @upload_objs are array of TWiki::Request::Upload objects
     my @fileNames = grep { defined $query->{uploads}{$_} }
+      map { s/.*[\/\\]//; $_ }
       map { $query->param("filepath$_") } ( '', 1 .. 9 );
     my @upload_objs = @{ $query->{uploads} }{@fileNames};

In case you are not familiar how patch works, edit twiki/lib/TWiki/UI/Upload.pm, go to line 230 and add above line indicated by the plus sign (but remove the plus sign).

Once you verified that this works, please use the new attach.pattern.tmpl to verify that the C:/fakepath/ is gone from the files listed below the file input field.

-- TWiki:Main.PeterThoeny - 2012-01-13

I found a Chrome with Win 7. I could verify the issue for file display (files listed below the file input field), however upload succeeded. After applying both patches, the display is correct too.

I patched twiki.org. Could you test in the Sandbox web on twiki.org if fixed with your browser?

-- TWiki:Main.PeterThoeny - 2012-01-13

This is now implemented in SVN trunk and 5.1 branch.

-- TWiki:Main.PeterThoeny - 2012-01-13

It looks like this fix introduced a new TWiki bug when using IE-8, Item6854.

-- TWiki:Main.PeterThoeny - 2012-03-04

Summary Can't upload attachments in Chrome
ReportedBy TWiki:Main.LisaTanguay
Codebase ~twiki4, 5.1.0
SVN Range

AppliesTo Engine
Component Attachments
Priority Normal
CurrentState Closed

Checkins TWikirev:22525 TWikirev:22526 TWikirev:22527 TWikirev:22528 TWikirev:22529 TWikirev:22530 TWikirev:22531 TWikirev:22532
TargetRelease patch
ReleasedIn 5.1.1
Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formattmpl attach.pattern.tmpl r3 r2 r1 manage 4.3 K 2012-01-13 - 23:14 PeterThoeny  
Edit | Attach | Watch | Print version | History: r14 < r13 < r12 < r11 < r10 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r14 - 2012-03-04 - PeterThoeny
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback