Re: Uploaded file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, April 26, 2007 2:08 pm, Stut wrote:
> PHP wrote:
>> How do I pass an uploaded file, from a form, to a class?
>>
>> I have a file type on the form called file.
>>
>> The variable $file is fine in my php code, can be used normally.
>>
>> But, I want to pass it to a class then manipulate the file, but it
>> does not work.
>>
>> $cMyClass->fnManipulateFile($file);

I suspect you are doing like this:

$file = $_FILES['file']['file_name'];
$cMyClass->fnManipulateFile($file);

You could do this instead:
$file = $_FILES['file'];
$cMyClass->fnManipulateFile($file);

Now you have an array coming in with all the elements you need,
file_name, error, original_name, etc.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux