Hi.

First of all: Thanks for your reply.
I finally got thinks working, somehow inspired by your mail.

Am Montag, den 31.07.2006, 15:00 -0400 schrieb beer:
> The results of $r->upload is a filehandle not a file.  You still need
> to read the file in.

I know. But since the module somehow crashes while creating the upload
object i cannot get the filehandle.

> Also if you want to print $r->upload and are expecting the name of the
> file to print, you have to change it to $r->upload.asString.

The problem was not to get the right things (there was logical error in
my first mail). The problem was to get anything. But since the module
crashed earlier this was not the point.

> I've not tried to do uploads using '$r', i think that maybe a new
> development since I built my upload component.  Here is basically how
> i do it:
> 
> my $q = $m->cgi_query;

You seem to be using Mason with CGI. However with mod_perl(2) the
$m->cgi_query method is not available. I had no success in creating a
CGI object with any other means.

Inspired by your mail i tried different ways to gain access to the
request. Finally i had success by getting the filehandle simply from the
args section. I don't know if there is anything evil with this since all
manuals on the mason site showed examples using the Apache::Upload
module. But it works for me.

<%args>
  $foo=>undef
</%args>
<%init>
if($foo) {
  while (<$foo>) {
    print $_;
  }
  close $foo;
}
</%init>

$foo is my filehandle here. So thats everything i need. I can now use it
to store the contents in other files or write them to database.


Mario


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to