Mailing List Archive

Multipart/form-data file uploads missing
Hello. I am migrating an older Catalyst app running in EC2 to a more
modern server. Everything works fine except for file uploads. There are
no files in the $c->req->param. Doesn't work with the built in server
or running as modperl in apache2. Been searching for some answers all
day with no luck. Anyone have any ideas what might have happened?



_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Re: Multipart/form-data file uploads missing [ In reply to ]
I think the file upload is in $c->request->upload - I have a file called
"image", which I access with $c->request->upload("image"), does that help?
Re: Multipart/form-data file uploads missing [ In reply to ]
There's no problem with my code - in fact I migrated to an Ubuntu 12.04
LTS EC2 image that I found and it is working fine there. I just won't
upgrade, I guess. Clearly something broken in whatever the newest
release that is in the 14.04 or 16.04 server packages.

-c



On 11/15/2016 2:27 AM, Chris Welch wrote:
> I think the file upload is in $c->request->upload - I have a file
> called "image", which I access with $c->request->upload("image"), does
> that help?
>
>
> _______________________________________________
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
Re: Multipart/form-data file uploads missing [ In reply to ]
Hi,
We need more info to help understand this.  Like from what version of Catalyst did you upgrade from and what is the new version?  Also we'd need to see more details about the actual code that is working differently.
In general AFAIK file uploads are supposed to be in $c->req->uploads although I also think the filename or something is in req->body_parameters.  In general I tell people to avoid ->param and ->parameters since the munging of GET and BODY parameters can lead to weird bugs and security issues so modifying your code might be worth the time.  ->param is especially problematic (see the security notes over at https://metacpan.org/pod/Catalyst::Request#req-param )
There was a lot of work done on those bits when we worked on the UTF-8 support stuff, FWIW.
Please consider trying to work through this rather than just introducing a local hack or just saying, "fuck it I'm not going to bother upgrading."  As an open source project Catalyst can only improve when people bother.  
If you can get on IRC (irc.perl.org#catalyst) you might be able to get more timely help.
jnap





On Tuesday, November 15, 2016 11:57 AM, Chris Huttman <chris@2020insightllc.com> wrote:


There's no problem with my code - in fact I migrated to an Ubuntu 12.04 LTS EC2 image that I found and it is working fine there.  I just won't upgrade, I guess.  Clearly something broken in whatever the newest release that is in the 14.04 or 16.04 server packages.

-c



On 11/15/2016 2:27 AM, Chris Welch wrote:

I think the file upload is in $c->request->upload - I have a file called "image", which I access with $c->request->upload("image"), does that help?

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/



_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/