Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

move_uploaded_file() error

Status
Not open for further replies.

speedyrudolf

Programmer
Sep 2, 2009
27
RO
Hi. While trying to test a some code, I ran into this error:
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to access Resource id #3/eroare.php in /home/ on line 10
The code is:
Code:
<?php
require("class.easyzip.php");
$timp=time();
$zip=new EasyZIP;
$file_dir="./upload".$timp;
mkdir($file_dir, 0777);
$dir=opendir($file_dir);
foreach($_FILES as $fisier=>$fisiere)
	{if(is_uploaded_file($fisiere['tmp_name']))
		{move_uploaded_file($fisiere['tmp_name'], "$dir/$fisiere[name]");}}
while(!(($fisier=readdir($dir))===false))
	{$zip->addFile($fisier);}
closedir($dir);
Does anyone know what the problem might be? Thank you.
 
change this line as shown

Code:
{move_uploaded_file($fisiere['tmp_name'], "$[red]file_[/red]dir/$fisiere[name]");}}

you were misusing the variable $dir (which had been assigned to a resource rather than a string).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top