Re: Uploaded file

From: Date: Thu, 26 Apr 2007 19:04:24 +0000
Subject: Re: Uploaded file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-253924@lists.php.net to get a copy of this message
On 4/26/07, PHP <php_list@ibcnetwork.net> wrote:
Hi, 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); the function fnManipulateFile gets $file only as the path the file was temporarily uploaded to (tmp/98rsof398) but the other variables are blank, such as $file_name. is it possible to do this? or do I have to pass each one, like $file_name, $file_size, etc.? Thanks, Chris
You should move your uploaded file first with the move_uploaded_file function, and then perform actions on it :) Tijnema

« previous php.general (#253924) next »