Re: Re: $_FILES passed by value

From: Date: Thu, 03 Jun 2004 15:23:25 +0000
Subject: Re: Re: $_FILES passed by value
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-187543@lists.php.net to get a copy of this message
Rob Adams wrote:
"Daniel Guerrier" <dan_guerrier@yahoo.com> wrote in message news:20040603145413.71652.qmail@web52002.mail.yahoo.com...
If I pass a $_FILES to an object by value. Does it create a copy of the actual posted files as well? In other words if I post a 2MB file to save.php and in turn pass $_FILES to an object $file->fileis($_FILES); Does that create 4MB of data in memory?
$_FILES is a super global. You really shouldn't have to pass it anywhere... It doesn't contain the actual file, just information about the file. IE. size name tmp_name type So if you do make a copy if it, you aren't copying the actual file that was uploaded, just an array of information. -- Rob
And the uploaded file is not kept in memory but in temporary file: $_FILES['uploadedfile']['tmp_name']

« previous php.general (#187543) next »