here is my code
$ex = sprintf("/home/fiveohtwo/public_html/fupa_files/%s",$userfile_name);
$fp = fopen($userfile_name, "w"); // create USER SPECIFIED file
copy("$userfile", "$ex");
fclose ($fp);
unlink("$userfile");
chmod($ex, 647);
if ( (filesize($ex)) <= 1 )
{
echo "<BODY><BR><BR><CENTER>File recieve FAILED!";
echo "<BR><A HREF=\"modify_fupa_area.php\">BACK</A></BODY>";
exec("rm $ex");
mysql_close($link_id);
die();
}
echo "<BODY><BR><BR><CENTER>File stat's please verify they are correct<BR><BR>";
echo "File name = ", $userfile_name, "<BR>";
echo "File path = ", $ex, "<BR>";
echo "File size = ", filesize($ex), "<BR></BODY>";
in my browse control on the form that calls this is "user_file"
hope this helps!