[prev in list] [next in list] [prev in thread] [next in thread]
List: mason
Subject: [Mason] Using uploadInfo with Mason
From: Patrick Michael Kane modus () pr ! es ! to
Date: 1999-07-29 16:39:13
[Download RAW message or body]
Sam,
Currently this information is not available via Mason. It would be trivial
to add it, however, so that the upload info is available via the
filename/filehandle scalar. I will post a patch to the list for you in a
bit and will incorporate this for 0.7.
* Sam Eaton (sam@pavilion.net) [990728 11:12]:
> I'm trying to get at the Content-type information from files uploaded
> through a multipart/form-data form.
>
> I get the filename and file contents correctly by using the field name
> as either a scalar or a filehandle, so I know that the parsing bit is
> being done correctly in Mason.
>
> Reading the CGI.pm docs, it seems that if I were using CGI.pm, I would
> do this :
>
> $filename = $query->param('uploaded_file');
> $type = $query->uploadInfo($filename)->{'Content-Type'};
>
> Not having a $query, I've tried this :
>
> $filename = $attach; # i.e. The field as a scalar
> $type = uploadInfo($filename)->{'Content-Type'};
>
> I get this error :
>
> Can't use an undefined value as a HASH reference
>
> Which would make sense if uploadInfo() isn't working right. If I just
> call uploadInfo directly, it doesn't appear to return anything, but
> doesn't give an error either.
>
> Is this a braino on my part? Should I be doing something differently?
> Or do I need to jump through different hoops to get at this information?
>
> Thanks,
>
> Sam.
> --
> ------------------------------------------------------------------------
> Sam Eaton Senior Systems Manager, Pavilion Internet Plc
> "Fortified with essential bitterness and sarcasm"
> ------------------------------------------------------------------------
> ======================================================================
> To unsubscribe: echo unsubscribe | mail mason-request@netizen.com.au
> Charter/FAQ/Archive: http://www.netizen.com.au/resources/lists/mason/
>
--
Patrick Michael Kane
<modus@pr.es.to>
======================================================================
To unsubscribe: echo unsubscribe | mail mason-request@netizen.com.au
Charter/FAQ/Archive: http://www.netizen.com.au/resources/lists/mason/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic