[Toolserver-l] Stange Perl (?) problem

Marco Schuster marco at harddisk.is-a-geek.org
Fri Sep 4 10:44:53 UTC 2009


On Fri, Sep 4, 2009 at 11:12 AM, Magnus Manske
<magnusmanske at googlemail.com>wrote:

> While I was on vacation, my CommonsHelper stopped working for direct
> upload. Here's what happens:
>
> * CommonsHelper (PHP) downloads an image to /tmp
> * CommonsHelper invokes upload bot written in Perl
> * Perl dies:
> Can't open file /tmp/chHHaikY-dir/dummy.jpg : No such file or
> directory at /opt/ts/perl/5.10/lib/vendor_perl/5.10/LWP/UserAgent.pm
> line 394
>
> However, the file exists at that point in time (this one still does on
> wolfsbane, feel free to check), and is readable for everyone.
>
> Any idea what's going on?
>

Yup. PHP exits and deletes the temp file before perl bot can start. Use
http://de.php.net/move_uploaded_file($_FILES['userfile']['tmp_name'],"/tmp/commonshelper-$random");
to prevent PHP from deleting the temp file.

Marco
-- 
VMSoft GbR
Nabburger Str. 15
81737 München
Geschäftsführer: Marco Schuster, Volker Hemmert
http://vmsoft-gbr.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wikimedia.org/pipermail/toolserver-l/attachments/20090904/7dc09ab6/attachment.htm 


More information about the Toolserver-l mailing list