FAQ
I have a controller subclassed from Catalyst::Controller::REST.

Most of my methods are happily ActionClass('REST')'d, but I have one
where I want a file to be uploaded and NOT
deserialized. Even if I did not include the ActionClass attribute, I
would get a complaint about no deserialization method for the upload.

I couldn't figure out how to do it, so I backed out the RESTness from
the controller and implemented a "straight" put method:

sub xxx :Local :Args(0) {
my ( $self, $c ) = @_;

return if $c->request->method ne 'PUT';

my $filecontents = '';

my ($fh) = $c->request->body;
while ( my $line = <$fh> )
{
$filecontents .= $line;
}

.... do something with it ...

$c->response->status('202');
$c->response->body( "stuff accepted" );

}

Is there a way to declare some paths as NOT subject to
deserialization? The reason I ask is that I want it for most
everything...just not for a few paths.

(Incidentally, am I doing the right thing to get the file contents? It
seems to work and I can't find any other doc/pointers)

FWIW I was using curl to test it:

curl -T somefile http://localhost:3000/demo/xxx

Thanks very much!

Bruce

---
Bruce McKenzie
brucem@dynamicrange.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090331/e6f7d21d/attachment.htm

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedApr 1, '09 at 5:03a
activeApr 1, '09 at 6:54a
posts2
users2
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase