You are here: Foswiki>Tasks Web>Item13830 (16 Nov 2015, GeorgeClark)Edit Attach

Item13830: Attachments with special characters (umlauts) in Foswiki 2.0.2 with mod_perl, reported as missing or empty file.

pencil
Priority: Urgent
Current State: Closed
Released In: 2.0.3
Target Release: patch
Applies To: Engine
Component: ModPerlEngineContrib
Branches: master
Reported By: PascalSchuppli
Waiting For: GeorgeClark
Last Change By: GeorgeClark
I'm running a vanilla 2.0.2 under apache mod_perl (linux box).

When I try to upload an attachment with Umlauts in the file name, this fails with the following error message (under PatternSkin):
Either you did not specify a file name, or the file you are trying to upload Säkularisierung.odt has no content. You may not upload an empty file.

Under NatSkin, the error message is a bit shorter: "Stream not found".

There are no error messages in any of the relevant log files.

I'm assuming the problem lies with using Foswiki with mod_perl because I have a Foswiki 2.0.2 running under plain CGI where the error does not manifest itself.

-- PascalSchuppli - 20 Oct 2015

Confirmed. Tested on Foswiki 2.0.2, Engine: Foswiki::Engine::Apache2::MP20, Apache2::Request v2.13, mod_perl2 v2.000009

-- GeorgeClark - 20 Oct 2015

I have a fix. See the patch at distro:072e35817178

-- GeorgeClark - 21 Oct 2015

I had a few minutes and tried the fix with NatSkin enabled. Now no attachments can be uploaded. The error I get is about not being able to parse the JSON response. I'm guessing this is a followup problem with TopicInteractionPlugin. I'll test some more when I get a bit more time (I especially haven't checked whether the fix works in non-NatSkin environments).

-- PascalSchuppli - 21 Oct 2015

Some more testing. I'm sorry, but the fix doesn't seem to work at all. I completely reinstalled foswiki 2.0.2 plus natskin extensions, but nothing else. Then patched Apache.pm. Now the error mentioned above when using the default PatternSkin Attach Link (Either you did not specify a filename.....) appears on every single upload attempt, no matter whether there is an umlaut in the filename or not.

On a side note, shouldn't the fix in the consequent of the if branch read Foswiki::decode_utf8 rather than foswiki::decode_utf8 ?

-- PascalSchuppli - 21 Oct 2015

Yes, that's the issue. Sorry about that. If you change it to Foswiki:: does that resolve things?

I suspect that you might not have the CPAN module Apache2::Request installed. The first pat of the patch is used if Apache2::Request is missing and Foswiki is running as a CGI application under mod_perl.

-- GeorgeClark - 21 Oct 2015

Oh. Changing foswiki to Foswiki fixes the problem under PatternSkin. Attaching files now works both for files with and without Umlauts.

-- PascalSchuppli - 21 Oct 2015

Just checked the fixed fix with NatSkin. It now works with NatSkin too. I'd say this is resolved.

-- PascalSchuppli - 21 Oct 2015
 

ItemTemplate edit

Summary Attachments with special characters (umlauts) in Foswiki 2.0.2 with mod_perl, reported as missing or empty file.
ReportedBy PascalSchuppli
Codebase 2.0.2
SVN Range
AppliesTo Engine
Component ModPerlEngineContrib
Priority Urgent
CurrentState Closed
WaitingFor GeorgeClark
Checkins distro:072e35817178 distro:c9bf5a4f67a1 distro:8b8a83b0d915
TargetRelease patch
ReleasedIn 2.0.3
CheckinsOnBranches master
trunkCheckins
masterCheckins distro:072e35817178 distro:c9bf5a4f67a1 distro:8b8a83b0d915
ItemBranchCheckins
Release01x01Checkins
Topic revision: r7 - 16 Nov 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy