Here's my coding:
<?
$path = "usr/home/bhills310/archerysports/assets/news/";
if (isset($image)) {
//$new_name = date("ymd").".jpg";
copy($_FILES["image"]["tmp_name"], $path.$_FILES["image"]['name']);
echo "The file now called $new_name was uploaded successfully.<br><br>";
echo "<a href=\"http://www.archerysportsusa.com".$path.$new_name."\">Click here to view it</a>";
} else {
echo "Browse your directory for a jpg to upload";
}
?>
<form action="<? echo $_SERVER["PHP_SELF"]; ?>" method="post" enctype="multipart/form-data" name="form" id="form">
<input type="hidden" name="MAX_FILE_SIZE" value="2048000"/>
<input name="image" type="file" id="image" size="60">
<br>
<br>
<input type="submit" name="Submit" value="Upload It">
</form>
Here's the error I'm getting:
Warning: copy(usr/home/bhills310/archerysports/assets/news/man&boar.jpg) [function.copy]: failed to create stream: No such file or directory in /usr/home/bhills310/archerysports/test_upload.php on line 6
I'm confused because /assets/news is a valid directory with the proper permissions set (chmod 777)
Any takers?