On Friday, September 30, 2016 at 5:39:33 AM UTC-7, Pierre Pannetier wrote:
>
> But i'm wondering it is possible to get this through something like
>
> my $pdfdata = $self->param('filepdf');
> my $jsondata = $self->param('text');
>
The "param" method of your Mojolicious::Controller object should work [1]
for accessing your POSTed files, but you can also try retrieving the files
directly from the Mojo::Message object [2] inside your controller;
# assuming '$self' isa Mojolicious::Controller object...
my $pdfdata = $self->req->upload('filepdf');
my $jsondata = $self->req->upload('text');
The above syntax is working for me uploading single files from iOS
(NSURLConnection) into Mojolicious. There's also a small mention of
uploads in the Mojolicious Tutorial [3].
Thanks,
Brian
[1] https://metacpan.org/pod/Mojolicious::Controller#param
[2] https://metacpan.org/pod/Mojo::Message#upload
[3]
https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Tutorial.pod#File-uploads
--
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.