[dancer-users] Code behaves differently on digitalocean.

Richard Reina gatorreina at gmail.com
Sun Jan 10 02:35:39 GMT 2016


This code works (the file uploads) when I run it from my web app on my
local host. However, it does not when I try it on the digitalocean version
of my app. I get no errors and $file->copy_to($destination) returns true.
But the file does not upload. Anyone have an idea as to what the problem
could be?

post '/upload' => sub {

    my $user_id = session 'UID';
    my $d_filename = 'user_' . $user_id . '.jpg';

    my $file = request->upload('file');
        my $tmpname = $file->tempname;
        my $destination = $upload_dir . '/' . $d_filename;
        my ($crslt) = $file->copy_to($destination) || warn $!;
        unlink $tmpname if -e $tmpname;

        debug "crslt: ", $crslt;

      template 'upload';

    redirect '/playerdash';
};
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20160109/e01cbb41/attachment.html>


More information about the dancer-users mailing list