Tags:
create new tag
, view all tags

FileUploadPluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on FileUploadPlugin contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below

Feedback on FileUploadPlugin

-- EdgarKlerks - 08 May 2007

Thank your for contributing this plugin!

Some feedback:

  • I moved it from the TWiki web to the Plugins web
  • Moved and changed the SHORTDESCRIPTION
  • It would be helpful to have a short description with use case
  • How about measuring and documenting the PluginBenchmarks numbers?
  • I added the package form. Please fill in the details.
  • Please package also as a .zip file, the standard for TWiki extensions.

-- PeterThoeny - 08 May 2007

Hee Peter, thanks for your reply. I shall make it an zip file. The benchmark thing is done, but itsn't really informative, because the plugin doesn't do anything on the view side, only when editting.

-- EdgarKlerks - 08 May 2007

Ah, from the description I got the impression that this plugin is for HTML forms embedded in TWiki topics. It would be good to describe the use case / installation to get this functionality in topic edit mode.

-- PeterThoeny - 16 May 2007

Heej Peter,

No that is not the case, but I will in some next release. I coded this for a project, where people had to add a picture and give some description of it. So it was done in edit mode, because this was the most convenient option with the wysiwyg editor. But I think it is quite easy to do so. Because it should be able to work with FormPlugin. - I upload the file in the beforeSaveHandler- But I have to test that first.

I will change the description a bit and after I tested it with FormPlugin, I will comment on that.

-- EdgarKlerks - 19 May 2007

Nopes It doesn't, that is too bad frown

-- EdgarKlerks - 19 May 2007

Edgar, the FileUploadPlugin.txt file is alomost empty (just the installation instructions are in it).

-- CarloSchulz - 31 May 2007

You are right, really strange. I don't get how that happened :? Nevermind, I will fix it. Thank you smile

-- EdgarKlerks - 01 Jun 2007

Hi Edgar, FileUploadPlugin does not work as expected on my TWiki.

Only the filename gets copied to the formfield but no file is attached. I installed both CPAN dependencies and followed the installation instructions. Any ideas what's wrong?

I found this in my apache error log:

[Thu Aug 09 18:32:45 2007] [error] [client 192.168.113.165]     , referer: http://192.168.113.12/twiki/bin/edit/Sandbox/FileUploadTest?t=1186677143
[Thu Aug 09 18:32:45 2007] [error] [client 192.168.113.165] [Thu Aug  9 18:32:45 2007] save: Use of uninitialized value in join or string at /usr/local/lib/perl/5.8.8/File/Spec/Unix.pm line 81., referer: http://192.168.113.12/twiki/bin/edit/Sandbox/FileUploadTest?t=1186677143
[Thu Aug 09 18:32:45 2007] [error] [client 192.168.113.165] [Thu Aug  9 18:32:45 2007] save: Use of uninitialized value in join or string at /usr/local/lib/perl/5.8.8/File/Spec/Unix.pm line 81., referer: http://192.168.113.12/twiki/bin/edit/Sandbox/FileUploadTest?t=1186677143
[Thu Aug 09 18:32:45 2007] [error] [client 192.168.113.165] [Thu Aug  9 18:32:45 2007] save: Use of uninitialized value in join or string at /usr/local/lib/perl/5.8.8/File/Spec/Unix.pm line 81., referer: http://192.168.113.12/twiki/bin/edit/Sandbox/FileUploadTest?t=1186677143

Is this somehow related to FileUploadPlugin?

TIA,

-- CarloSchulz - 09 Aug 2007

He CarloSchulz, I will look after it smile Maybe something changed in one of the dependencies. Thanks for reporting!

-- EdgarKlerks - 10 Aug 2007

Can you provide me with some information? I would like to know, which twiki version you use and which version of File::Spec, File::Magic and File::Mimeinfo you use. I don't have the same problems with my version, so I would like to test the matter. Thanks in advance.

-- EdgarKlerks - 10 Aug 2007

Thanks for your help Edgar smile

  • TWiki 4.1.2
  • linux, debian

Not 100% sure if I picked up the right ones so I included the path...

  • File::Spec ( /usr/local/lib/perl/5.8.8/File/Spec.pm/ )
    • $VERSION = '3.25';

  • File::MMagic ( /usr/local/share/perl/5.8.8/File/MMagic.pm )
    • $VERSION = "1.27";
      (this was somewhere in the code)
    • # $ Id: MMagic.pm 259 2006-05-23 05:55:32Z knok $    
      (this was in the comment section)

  • File::MimeInfo ( /usr/local/share/perl/5.8.8/File/MimeInfo.pm )
    • $VERSION = '0.14';

I checked cpan for newer versions - they are all up to date:


cpan> install File::MimeInfo
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
  Database was generated on Thu, 09 Aug 2007 09:48:32 GMT
File::MimeInfo is up to date.

cpan> install File::MMagic
File::MMagic is up to date.

cpan> install File::Spec
File::Spec is up to date.

-- CarloSchulz - 10 Aug 2007

I have problems reproducing the problem. I have updated to the same twiki version as you and have updated all mine cpan packages. But I can't trigger it.

Do you use parameters like: maxsize{10M} pattern{/[^ ]+.mp3/} mime_check{rename} Can you post them and can you post the other plugins, which are installed on your twiki? I would be really grateful. Thanks!

Another thing, that can be handy are the relevant logs from your twiki/data directory. You can just send me the relevant lines, that should be sufficient.

-- EdgarKlerks - 12 Aug 2007

I think I found something, Sandbox.pm is using File::Spec. I will keep you updated, if I find the cause. Outside of the Sandbox it will run fine.

-- EdgarKlerks - 13 Aug 2007

The sandbox seems to work too. Don't know what goes wrong. I think I need the extra information (logs, plugins installed etc).

-- EdgarKlerks - 13 Aug 2007

I have pinpointed the place, where it goes wrong. Line 147 of Sandbox.pm, normalizeFilename. Not sure what happens, but I will look tomorrow to it.

-- EdgarKlerks - 13 Aug 2007

Hi Edgar. Just arrived back from the TWikiCommunitySummitRome2007.

Do you know already know what happend? Do you need more info?

-- CarloSchulz - 21 Aug 2007

Hi Carlo, I was having holiday. I hope you enjoyed Rome smile

I hope I found something. Can you try again with the new version?

-- EdgarKlerks - 26 Aug 2007

Late response, but unfortunatelly still not working.

The formfield recieves a value but no file is uploaded:

formfieldupload.png

-- CarloSchulz - 26 Sep 2007

I gave it another try. Different twiki and different error this time: TWikiVMDebianStable.

Can't locate object method "woops" via package "TWiki::Plugins::FileUploadPlugin::Core" at /home/httpd/twiki/lib/TWiki/Plugins/FileUploadPlugin/Core.pm line 200.
 at /home/httpd/twiki/lib/TWiki/Plugins/FileUploadPlugin/Core.pm line 200
   TWiki::Plugins::FileUploadPlugin::Core::file_check('TWiki::Plugins::FileUploadPlugin::Core=HASH(0x93bbaac)', 'DesignAndConcept', 'WebHome', 'HASH(0x91d21c4)', 20480, 'ibm.css') called at /home/httpd/twiki/lib/TWiki/Plugins/FileUploadPlugin/Core.pm line 93
   TWiki::Plugins::FileUploadPlugin::Core::upload_file('TWiki::Plugins::FileUploadPlugin::Core=HASH(0x93bbaac)', '%META:TOPICINFO{author="TWikiAdmin" date="1209050201" format=...', 'WebHome', 'DesignAndConcept', '', 'TWiki::Meta=HASH(0x84080f8)', 'HASH(0x91d21c4)', 'Fh=GLOB(0x83ca2bc)', 'Fh=GLOB(0x83ca2bc)', ...) called at /home/httpd/twiki/lib/TWiki/Plugins/FileUploadPlugin.pm line 108
   TWiki::Plugins::FileUploadPlugin::afterSaveHandler('%META:TOPICINFO{author="TWikiAdmin" date="1209050201" format=...', 'WebHome', 'DesignAndConcept', '', 'TWiki::Meta=HASH(0x84080f8)') called at /home/httpd/twiki/lib/TWiki/Plugin.pm line 225
   TWiki::Plugin::invoke('TWiki::Plugin=HASH(0x8dc833c)', 'afterSaveHandler', '%META:TOPICINFO{author="TWikiAdmin" date="1209050201" format=...', 'WebHome', 'DesignAndConcept', '', 'TWiki::Meta=HASH(0x84080f8)') called at /home/httpd/twiki/lib/TWiki/Plugins.pm line 303
   TWiki::Plugins::_dispatch('TWiki::Plugins=HASH(0x8248d30)', 'afterSaveHandler', '%META:TOPICINFO{author="TWikiAdmin" date="1209050201" format=...', 'WebHome', 'DesignAndConcept', '', 'TWiki::Meta=HASH(0x84080f8)') called at /home/httpd/twiki/lib/TWiki/Plugins.pm line 631
   TWiki::Plugins::afterSaveHandler('TWiki::Plugins=HASH(0x8248d30)', '%META:TOPICINFO{author="TWikiAdmin" date="1209050201" format=...', 'WebHome', 'DesignAndConcept', '', 'TWiki::Meta=HASH(0x84080f8)') called at /home/httpd/twiki/lib/TWiki/Store.pm line 863
   TWiki::Store::saveTopic('TWiki::Store=HASH(0x88a0ea0)', 'TWiki::User=HASH(0x8a60700)', 'DesignAndConcept', 'WebHome', 'This, of course, is not the real copy for this advertisement....', 'TWiki::Meta=HASH(0x92316e8)', 'HASH(0x92316d0)') called at /home/httpd/twiki/lib/TWiki/UI/Save.pm line 461
   TWiki::UI::Save::__ANON__() called at /home/httpd/twiki/lib/CPAN/lib///Error.pm line 379
   eval {...} called at /home/httpd/twiki/lib/CPAN/lib///Error.pm line 371
   Error::subs::try('CODE(0x86271cc)', 'HASH(0x925da24)') called at /home/httpd/twiki/lib/TWiki/UI/Save.pm line 469
   TWiki::UI::Save::save('TWiki=HASH(0x814fad4)') called at /home/httpd/twiki/lib/TWiki/UI.pm line 109
   TWiki::UI::__ANON__() called at /home/httpd/twiki/lib/CPAN/lib///Error.pm line 379
   eval {...} called at /home/httpd/twiki/lib/CPAN/lib///Error.pm line 371
   Error::subs::try('CODE(0x925d658)', 'HASH(0x9231964)') called at /home/httpd/twiki/lib/TWiki/UI.pm line 158
   TWiki::UI::run('CODE(0x82f75e0)') called

-- CarloSchulz - 24 Apr 2008

Thanks, I will look at this plugin again. I am sorry I was busy with other projects

-- EdgarKlerks - 30 Apr 2008

No worries smile

-- CarloSchulz - 05 May 2008

I'm using TWiki 4.2.0 build 16278 (the latest) with ActivePerl 5.8.8 (the latest) and I'm getting the following error when attempting to upload 3 files from within a TWikiForm in my Sandbox web.

Can't locate object method "mime_check" via package "TWiki::Plugins::FileUploadPlugin::Core" at D:/inetpub/appsweb/twiki/lib/TWiki/Plugins/FileUploadPlugin/Core.pm line 101. at D:/inetpub/appsweb/twiki/lib/TWiki/Plugins/FileUploadPlugin/Core.pm line 101 TWiki::Plugins::FileUploadPlugin::Core::upload_file('TWiki::Plugins::FileUploadPlugin::Core=HASH(0x5e120cc)', '%META:TOPICINFO{author="moorej" date="1213875024" format="1.1...', 'SampleApplication1', 'Sandbox', '', 'TWiki::Meta=HASH(0x5e6d71c)', 'HASH(0x522437c)', 'Fh=GLOB(0x59dc450)', 'Fh=GLOB(0x59dc450)', ...) called at D:/inetpub/appsweb/twiki/lib/TWiki/Plugins/FileUploadPlugin.pm line 108 TWiki::Plugins::FileUploadPlugin::afterSaveHandler('%META:TOPICINFO{author="moorej" date="1213875024" format="1.1...', 'SampleApplication1', 'Sandbox', '', 'TWiki::Meta=HASH(0x5e6d71c)') called at D:/inetpub/appsweb/twiki/lib/TWiki/Plugin.pm line 266 TWiki::Plugin::invoke('TWiki::Plugin=HASH(0x5e6de48)', 'afterSaveHandler', '%META:TOPICINFO{author="moorej" date="1213875024" format="1.1...', 'SampleApplication1', 'Sandbox', '', 'TWiki::Meta=HASH(0x5e6d71c)') called at D:/inetpub/appsweb/twiki/lib/TWiki/Plugins.pm line 344 TWiki::Plugins::_dispatch('TWiki::Plugins=HASH(0x5e7ca6c)', 'afterSaveHandler', '%META:TOPICINFO{author="moorej" date="1213875024" format="1.1...', 'SampleApplication1', 'Sandbox', '', 'TWiki::Meta=HASH(0x5e6d71c)') called at D:/inetpub/appsweb/twiki/lib/TWiki/Plugins.pm line 675 TWiki::Plugins::afterSaveHandler('TWiki::Plugins=HASH(0x5e7ca6c)', '%META:TOPICINFO{author="moorej" date="1213875024" format="1.1...', 'SampleApplication1', 'Sandbox', '', 'TWiki::Meta=HASH(0x5e6d71c)') called at D:/inetpub/appsweb/twiki/lib/TWiki/Store.pm line 885 TWiki::Store::saveTopic('TWiki::Store=HASH(0x5f6ee7c)', 'moorej', 'Sandbox', 'SampleApplication1', '---+ Sample Application 1\x{a}', 'TWiki::Meta=HASH(0x5d01098)', 'HASH(0x5881898)') called at D:/inetpub/appsweb/twiki/lib/TWiki/UI/Save.pm line 541 TWiki::UI::Save::__ANON__() called at D:/inetpub/appsweb/twiki/lib/CPAN/lib//Error.pm line 379 eval {...} called at D:/inetpub/appsweb/twiki/lib/CPAN/lib//Error.pm line 371 Error::subs::try('CODE(0x60b3508)', 'HASH(0x56ea180)') called at D:/inetpub/appsweb/twiki/lib/TWiki/UI/Save.pm line 550 TWiki::UI::Save::save('TWiki=HASH(0x63bf68)') called at D:/inetpub/appsweb/twiki/lib/TWiki/UI.pm line 159 TWiki::UI::__ANON__() called at D:/inetpub/appsweb/twiki/lib/CPAN/lib//Error.pm line 379 eval {...} called at D:/inetpub/appsweb/twiki/lib/CPAN/lib//Error.pm line 371 Error::subs::try('CODE(0x60bcf7c)', 'HASH(0x6097900)') called at D:/inetpub/appsweb/twiki/lib/TWiki/UI.pm line 197 TWiki::UI::run('CODE(0x585ada0)', 'save', 1) called at D:/inetpub/appsweb/twiki/bin/save line 32 ModPerl::ROOT::ModPerl::Registry::D_3a_inetpub_appsweb_twiki_bin_save::handler('Apache2::RequestRec=SCALAR(0x5f1dd5c)') called at C:/Perl/site/lib/ModPerl/RegistryCooker.pm line 204 eval {...} called at C:/Perl/site/lib/ModPerl/RegistryCooker.pm line 204 ModPerl::RegistryCooker::run('ModPerl::Registry=HASH(0x5e1d59c)') called at C:/Perl/site/lib/ModPerl/RegistryCooker.pm line 170 ModPerl::RegistryCooker::default_handler('ModPerl::Registry=HASH(0x5e1d59c)') called at C:/Perl/site/lib/ModPerl/Registry.pm line 31 ModPerl::Registry::handler('ModPerl::Registry', 'Apache2::RequestRec=SCALAR(0x5f1dd5c)') called at -e line 0 eval {...} called

-- JamesGMoore - 19 Jun 2008

By the way I previously installed the FileUploadPlugin plugin by unzipping the contents to my TWiki installation folder which is D:\inetpub\appsweb\twiki and then edited the lib\LocalSite.cfg and inserted the following line just before the last line which has a "1;" on it.

$TWiki::cfg{Plugins}{FileUploadPlugin}{MagicFile} = 'C:/Program Files/Apache Software Foundation/Apache2.2/conf/magic';

-- JamesGMoore - 19 Jun 2008

I've put more info on my user info, just click my name and read the TWiki Usage section.

-- JamesGMoore - 19 Jun 2008

Dear all I met a problem , while I use "Firefox" as my browser , use FileUploadPlugin to upload File is OK, After that , then click attachment file can open and download.

But when I use "Internet Explorer", in the same way , use FileUploadPlugin to upload File, the file name became "Full-Path Location+Filename"(In "Firefox" situation, attachment file's name just fileName, no append "Full-Path"location), then click this attachment file is fail, error message is "xxxx file does not exist"

any ideas ??

Thanks a lot

-- BretHuang - 23 Sep 2008

The topic page has a spurrious <pre><table cellspacing="1" cellpadding="0" border="1" /></pre> tag under the installation instructions that messes up formatting from there to the end of the page. Looks like that needs to be removed and the contents table formatting restored.

-- TimotheLitt - 2010-03-11

I cannot get this to work. My simple form (using TWiki 5.1.1 and <literal>'2fad14e5fc4744820561a15d9ae21819 FileUploadPlugin.tgz'</literal>, looks like the following:

Name Type Size Values Tooltip message Attributes
File file 20   Size less than 20M maxsize{20M} pattern{/\w+.twiki/ig}

Yet, when I run it, I get the File Browser prompt and can select a file, but when I select "foo.twiki", I get: <VERBATIM> File foo.twiki does not match the pattern.

%PARAM3%

%PARAM4% OK

</VERBATIM>

Ideas?

-- KenMiller - 2012-04-13

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng formfieldupload.png r1 manage 1.6 K 2007-09-26 - 14:57 CarloSchulz  
Edit | Attach | Watch | Print version | History: r22 < r21 < r20 < r19 < r18 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r22 - 2012-04-13 - KenMiller
 
  • 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.