Hi Aron,
Yesterday M. Aaron Bossert wrote:
> All,
>
> I have a working app with the following route:
>
> post '/raw_upload' => sub {
> my $self = shift;
> my $file = $self->req->upload('upload');
> if($file) {
>
> $file->move_to($dataDir.$self->session('user').'/raw/'.$file->filename);
> $self->rendered(200);
> }
> else {
> $self->rendered(500);
> }
>
>
> };
>
> Where I am falling flat is with larger files. I am not sure exactly what
> the threshold is, but certainly, a 100MB file is fine (I upped the max
> message size to 2GB), but a 900MB file does not show up. It just silently
> fails with no visible signs of errors. I checked for an inactivity
> timeout...which was not the issue (anymore)...and there are no error
> messages anywhere I can see (client or server side). Any ideas as to what
> is happening? With smaller files, the file just shows up in the
> appropriate directory...with a large file, it "acts" as if it is
> transferring...but nothing ever shows up.
>
> The only thing I could even think of was that the Asset is perhaps
> switching from a memory to a file one? Even so, I am not sure why that
> would matter. My server is pretty beefy (512GB of RAM, 24Cores) and I
> would not expect a 1GB file to cause so much as a hiccup on the memory side
> of the house...but what do I know?
>
> Any suggestions would be appreciated...and if appropriate, would it be
> better to copy/move the file as it comes in, rather than as a whole? Also,
> as a side note...I ended up setting the inactivity timeout as an
> environment variable (globally)...which I don't really want to do...but
> when I use: Mojo::IOLoop->stream($self->tx->connection)->timeout(6000)
> within my route (right after "my $self=shift;")...it does not have any
> effect..any thoughts on that would be appreciated as well...
I have only been fighting with this ... it all seemed rather
difficult to reproduce probably also connectd to some browser
issues ...
I ended up using http://github.com/23/resumable.js
here is the program I wrote around it:
https://github.com/oetiker/upload-service
cheers
tobi
--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
www.oetiker.ch [email protected] +41 62 775 9902
--
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 http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.