add spec dependency
[ikiwiki] / doc / bugs / attachment_upload_does_not_work_for_windows_clients.mdwn
1 It seems as if windows clients (IE) submit filenames with backslash as directory separator.
2 (no surprise :-).
3
4 But the attachment plugin translates these backslashes to underscore, making the
5 whole path a filename.
6
7 > As far as I can see, that just means that the file will be saved with
8 > a filename something like `c:__92__My_Documents__92__somefile`.
9 > I don't see any "does not work" here. Error message?
10
11 > Still, I don't mind adding a special case, though obviously not in
12 > `basename`. [[done]] --[[Joey]] 
13
14 >> Well, it's probably something else also, I get **bad attachment filename**.
15 >> Now, that could really be a bad filename, problem is that it wasn't. I even
16 >> tried applying the **wiki_file_prune_regexps** one by one to see what was
17 >> causing it. No problem there. The strange thing is that the error shows up
18 >> when using firefox on windows too. But the backslash hack fixes at least the
19 >> incorrect filename from IE (firefox on windows gave me the correct filename.
20 >> I'll do some more digging... :-)  /jh
21
22 This little hack fixed the backslash problem, although I wonder if that
23 really is the problem?
24 (Everything works perfectly from linux clients of course. :-)
25
26         sub basename ($) {
27                 my $file=shift;
28
29                 $file=~s!.*/+!!;
30                 $file=~s!.*\\+!!;
31                 return $file;
32         }
33
34 Should probably be `$file=~s!.*[/\\]+!!` :-)