move_uploaded_file isn't doing anything

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
MoFu
Forum Members
Forum Members
Posts: 15
Joined: Fri Mar 28, 2008 11:15 am

move_uploaded_file isn't doing anything

Post 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
alby

Re: move_uploaded_file isn't doing anything

Post 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
MoFu
Forum Members
Forum Members
Posts: 15
Joined: Fri Mar 28, 2008 11:15 am

Re: move_uploaded_file isn't doing anything

Post 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
Post Reply

Return to “Modules/Add-Ons”