help in upload file coding
Posted: Tue Feb 10, 2004 11:13 pm
Code: Select all
// Create the file name.
$extension = explode ('.', $_FILESї'upload']ї'name']);
$filename = $ref . '.' . $extensionї1];
// Move the file over.
if (move_uploaded_file($_FILESї'upload']ї'tmp_name'], "/home/server/public_html/trial/images/")) {
//increase the number of songs uploaded
$numupload = $numupload + 1;
$query = "UPDATE user SET numupload='$numupload' WHERE useracc={$_SESSIONї'useracc']}";
$result = @mysql_query ($query); // Run the query.
echo '<p>The file has been uploaded!</p>';
exit();
} else {
echo '<p><font color="red">The file could not be moved.</font></p>';
exit();
}coz when i run it, i get an error message like this
"
Warning: move_uploaded_file(/home/server/public_html/trial/images/): failed to open stream: Is a directory in /home/server/public_html/trial/uploadsong.php on line 61
Warning: move_uploaded_file(): Unable to move '/tmp/phpavgk3i' to '/home/server/public_html/trial/images/' in /home/server/public_html/trial/uploadsong.php on line 61 "
can someone help me??