Hello gurus,
I'm making a new website, which can let users upload their photos.
I follow this example:
http://d.hatena.ne.jp/yukikimoto/20100212/1265989676
Everything goes well except I try to upload a pic which's size is bigger
than 512K.
Firefox says "The connection was reset" and the photo is only partial
uploaded when I check the page.
I noticed that all files which should be >512K, has only 512K (partial)
uploaded and saved into my disk.
I'm using perl 5.10.1, with Mojolicious 0.999924.
My question is:
1. Is there (and why is there) a 512K limitation of uploading size?
2. How could I tune the upload size limit to a bigger number?
Best wishes,
BlueT
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEUEARECAAYFAku91KYACgkQfoJ/q1KWx6g5YACfSGZUZHE/3Ne/E88ouB7O1DCF
eDYAmMrv3p5M24fD8V2wDzuqj6GrBEI=
=xRG4
-----END PGP SIGNATURE-----
# Upload max size
my $upload_max_size =3 *1024 *1024;
# Over max size
if ($image->size> $upload_max_size) {
return $self->render(
template=> 'error',
message=> "Upload fail. Image size is too large."
);
}
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
--
To unsubscribe, reply using "remove me" as the subject.
Yes, I know that's a 3 MB limit.
But now I cannot even upload a file >512K.
(I was trying to upload files aroud 1~2M, not bigger than 3M :S)
iEYEARECAAYFAku92IIACgkQfoJ/q1KWx6h9LgCeJmRjUUhQbRILzQmWWvrFI4nj
p64An1RJjm7N0DZAhSvFzmSfNoJD0joT
=OR9d
-----END PGP SIGNATURE-----
This.
Btw. You can capture uploads that were too big by checking $self->req->error for a 413 and then send a friendly error message back.
--
Sebastian Riedel
http://labs.kraih.com
http://mojolicious.org
http://twitter.com/kraih
Btw. You can capture uploads that were too big by checking $self->req->error for a 413 and then send a friendly error message back.
--
Sebastian Riedel
http://labs.kraih.com
http://mojolicious.org
http://twitter.com/kraih
--
To unsubscribe, reply using "remove me" as the subject.
Yes, right in the action, it's basically just like a normal action call only the upload was interrupted.
http://github.com/kraih/mojo/blob/master/t/mojolicious/lite_app.t#L58
Error handling like this is still a work in progress, so feedback would be appreciated, even if it just works for you. ;)
It works, thanx alot!
I wonder why I can't see this on the pod/documents, it's really useful
and many some kind of FAQ I think.
(or maybe it's already documented in some documents but I missed them?)
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> --
> To unsubscribe, reply using "remove me" as the subject.
> --
> С уважением,
> Анатолий Шарифулин.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAku+FZ4ACgkQfoJ/q1KWx6g3tACfVm34cbkDiNgwrp55epN4sLrI
cXwAoJEoI6krAFvWxdxDpShFPkMGadKz
=HpVd
-----END PGP SIGNATURE-----
--
To unsubscribe, reply using "remove me" as the subject.