Understood. 

I was originally not aware of the distinction within the Mojo;;Upload... 
until I read the documentation.  ;-)
I was always expecting a Mojo::File::Asset.  Since my real files are all 
large I did not notice until I started testing bad input and smaller files.

FYI: I could not get the tempfile method to work until I split out the 
assignment from the move_to. It returned a GLOB and not a path. That caused 
move_to to fail to convert.

This is what worked for me:
    (undef, $path) = tempfile; # I only care about the path.
    $miffile->move_to($path);

I am not sure why. I am using perl 5.22.4 and a fairly recent Mojolicious. 

I also now have to handle the temporary file deletion on my own. 
Mojo::File::Asset gave me that for free. I may re-code it with a File::Temp 
object...

It works! I am happy. Thanks again.

Nicky

On Saturday, February 3, 2018 at 2:29:53 PM UTC-7, sri wrote:
>
> We've been thinking about adding Mojo::Asset::*::to_file methods that would
> guarantee a Mojo::Asset::File object, but it's so rarely needed that it 
> doesn't
> seem worth it.
>
> --
> sebastian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to