[Dancer-users] File extension

Alex 800 at ru07.com
Mon Jun 4 08:03:33 CEST 2012

Hi all!

I have a question about Dancer::Request::Upload.

Quote: “
Returns the name of the temporary file the data has been saved to.
This will be in e.g. /tmp, and given a random name, with no file

This is my code:

post '/upload/:token' => sub {

        return to_dumper(request->upload('file'));


This is the result:

$VAR1 = bless( { 'headers' => { 'Content-Type' => 'image/png',
'Content-Disposition' => 'form-data; name="file";
filename="2.png"' }, 'filename' => '2.png', 'tempname' =>
'/tmp/QBVx5KfQtB.png', 'size' => '33116' }, 'Dancer::Request::Upload' );

Why does 'tempname' have file extension ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20120604/21511781/attachment-0001.htm>

More information about the Dancer-users mailing list