71fnRVVm
September 17th, 2007, 07:09 PM
Hey everyone,
I'm having an issue with uploading an image through PHP to a specific directory... I've banged my head on this for a few days, and talked to other people that work on this server... but there is no reason why we can see it's not working.
// ... already grabs file information, $f_temp is the temporary location of the uploaded file
$target_dir = '/usr/local/apache/htdocs/_images/user_upload/';
$target_dir = $target_dir . basename($f_name);
$moved = move_uploaded_file($f_temp, $target_dir);
if ($moved != FALSE) {
// shows error
} else {
// continues
}
The directory has been CHMOD'd properly to allow access, PHP isn't spitting out any errors, there's no errors in the apache logs. It "pretends" like it works, and continues on to the success portion of the code, because move_uploaded_file() doesn't return an error.
I even went so far as to print to screen the temp file info ($f_temp) and the new file info ($target_dir)... both existed, both were correct.
Any ideas why this isn't working? We were getting an error about SAFE_MODE directory permissions, so we turned SAFE_MODE off... but that didn't help.
Thanks
I'm having an issue with uploading an image through PHP to a specific directory... I've banged my head on this for a few days, and talked to other people that work on this server... but there is no reason why we can see it's not working.
// ... already grabs file information, $f_temp is the temporary location of the uploaded file
$target_dir = '/usr/local/apache/htdocs/_images/user_upload/';
$target_dir = $target_dir . basename($f_name);
$moved = move_uploaded_file($f_temp, $target_dir);
if ($moved != FALSE) {
// shows error
} else {
// continues
}
The directory has been CHMOD'd properly to allow access, PHP isn't spitting out any errors, there's no errors in the apache logs. It "pretends" like it works, and continues on to the success portion of the code, because move_uploaded_file() doesn't return an error.
I even went so far as to print to screen the temp file info ($f_temp) and the new file info ($target_dir)... both existed, both were correct.
Any ideas why this isn't working? We were getting an error about SAFE_MODE directory permissions, so we turned SAFE_MODE off... but that didn't help.
Thanks