Hi !
I have a problem with an file upload module. It works perfectly in local but the file is not saved on the server.
Is it a writting right problem on the server?
Thanks for your help !
problem with file to upload to the server : SOLVED
Moderator: General Moderators
- orangeapple
- Forum Commoner
- Posts: 70
- Joined: Tue Jan 06, 2004 1:24 pm
- Location: Geneva / Switzerland
problem with file to upload to the server : SOLVED
Last edited by orangeapple on Mon Oct 31, 2005 8:32 am, edited 1 time in total.
Just check each upload process to see what is going wrong! All upload functions and file handling functions return BOOL true or false.
yj
Code: Select all
if ( move_uploaded_file ( $_FILES['up']['tmp_name'], 'some_path_some_file.some_ext' ) !== false )
{
echo 'nice file move';
}
else
{
echo 'oh no, file move failed';
}yj
- orangeapple
- Forum Commoner
- Posts: 70
- Joined: Tue Jan 06, 2004 1:24 pm
- Location: Geneva / Switzerland
- orangeapple
- Forum Commoner
- Posts: 70
- Joined: Tue Jan 06, 2004 1:24 pm
- Location: Geneva / Switzerland
here it is :
Code: Select all
$upfiles = '../reports/'.$userfiles_name;
if ($userfilesnot !==0)
{
if (is_uploaded_file($userfiles))
{
if (!move_uploaded_file($userfiles, $upfiles))
{
echo 'Problem: Could not move file to destination directory';
exit;
}
}
else
{
echo 'Problem: Possible file upload attack. Filename: '.$userfiles_name;
exit;
}
}- orangeapple
- Forum Commoner
- Posts: 70
- Joined: Tue Jan 06, 2004 1:24 pm
- Location: Geneva / Switzerland