Hi again:
Thanx for your replies.
I have revised the code, few of the problems have dissapeared 🙂 , but two still persist! 🙁
I'm attaching the code at the end.
Basically the copy line is not working.
I get an error like this:
Warning: Unable to open 'test.jpg' for reading: No such file or directory in c:\apache\htdocs\soccermania\game\upload.php on line 19
Line 19 is :
copy($myFile,$upfile);
The file doesn't get uploaded.
I'm going to bang my head on the wall a bit, until someone helps me!
tx
Kamy
<html>
<head>
<title>UPLOAD</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<?
global $Action;
global $userfile;
global $userfile_name;
global $upfile;
global $PHP_SELF;
if(isset($_GET['Action']))
{
$userfile_name=$_FILES['userfile']['name'];
$upfile="../images/".$userfile_name;
$myFile=$_FILES['userfile']['name'];
is_uploaded_file($myFile);
copy($myFile,$upfile);
echo "<hr>";
?>
<?
echo "<hr>";
if (!is_uploaded_file($_FILES['userfile']['name']))
{echo "failed";}
}
else
{
global $Action;
global $userfile;
global $userfile_name;
global $upfile;
?>
<form enctype="multipart/form-data" action="?Action=Upload" method="post" >
<input type="hidden" name="MAX_FILE_SIZE" value="100000000000">
Upload a file: <input type="file" name="userfile" class="ViewForm">
<input type="submit" value="Upload" class="AdminOptions">
</form>
<?
}
?>
</body>
</html>