$p=mysql_query('SELECT download_path from config'); $path = $p[0].$_FILES['upload']['name']; move_uploaded_file($_FILES['upload']['tmp_name'], $path); Code (markup): The script is attempting to move the file to "/home/xxxxx/downloads/" which I've got CHMODed to 777... anything else that could be causing this problem?
you've forgotten to do mysql_fetch_assoc after query. this will look like: $p=mysql_query('SELECT download_path from config'); $row = mysql_fetch_assoc($p); $path = $row['download_path'].$_FILES['upload']['name']; move_uploaded_file($_FILES['upload']['tmp_name'], $path);
$p=mysql_query('SELECT download_path from config'); $p_result=mysql_result($p, 0); $path = $p_result.$_FILES['upload']['name']; Code (markup): I fixed it just moments before you posted using this. While this code works is it acceptable or am I going to have problems if I use it elsewhere?
echo $path before move_uploaded_file($_FILES['upload']['tmp_name'], $path); If the directory is indeed correct, check that the parent directories also are chmoded to 777. Also check the ownership (chown,chgrp) to be general (either apache or the username). Peace,