I have a file that I am working on for an Admin CP upload of an image. I'm running into a problem on trying to get it to successfully upload the file. Here is my coding:
PHP Code:
$vbulletin->input->clean_array_gpc('p', array(
'name' => TYPE_STR,
'url' => TYPE_STR,
'description' => TYPE_STR,
'type' => TYPE_INT,
'enable' => TYPE_INT,
));
$vbulletin->input->clean_gpc('f', 'image', TYPE_FILE);
if ($vbulletin->GPC['image'] == '')
{
print_stop_message('adright_no_image');
}
$dir = dirname(__FILE__);
$dir .= "/adright/";
if (!is_dir($dir)) {
print_stop_message('adright_bad_directory');
} else {
$new_file = $dir . basename($vbulletin->GPC['image']['name']);
print $new_file;
if (!move_uploaded_file($vbulletin->GPC['image']['tmp_name'], $new_file)) {
die('An error has occurred<br />' . $vbulletin->GPC['image']['error']);
}
}
The only output I ever get is
An error has occurred. The file is never uploaded and it doesn't seem to be grabbing my image file correctly for the upload process. I know the upload image form is working because I never visibly see the phrase related to not entering an image. Any help on where I am going wrong would be greatly appreciated.