Page 1 of 1
move_uploaded_file isn't doing anything
Posted: Fri Apr 25, 2008 11:21 am
by MoFu
Hello,
I want to uploade a file. I have all the needed data for moving my file from the temp folder but it's not working.
Code:
$filename = $_FILES[$id.'upload']['name'];
$dir = $config['uploads_path'] . '/' . $filename;
I hope you can help me
Thx
Re: move_uploaded_file isn't doing anything
Posted: Fri Apr 25, 2008 11:44 am
by alby
MoFu wrote:
I want to uploade a file. I have all the needed data for moving my file from the temp folder but it's not working.
Code:
$filename = $_FILES[$id.'upload']['name'];
$dir = $config['uploads_path'] . '/' . $filename;
I hope you can help me
Maybe:
Code: Select all
if( (isset($_FILES[$id.'upload'])) && (is_uploaded_file($_FILES[$id.'upload']['tmp_name'])) )
{
global $gCms;
$filepath = $gCms->config['uploads_path'] .DIRECTORY_SEPARATOR. $_FILES[$id.'upload']['name'];
cms_move_uploaded_file($_FILES[$id.'upload']['tmp_name'], $filepath);
}
Alby
Re: move_uploaded_file isn't doing anything
Posted: Fri Apr 25, 2008 12:36 pm
by MoFu
Thank you very much ... it works
But can you explane when I have to use the global $gCms? I couldn't find any information about that.
Bye
Robert