I'm having problems using this... this is my code...
Code:
$file = $vbulletin->input->clean_gpc("f","upload",TYPE_FILE);
if ($file)
{
upload_game($game);
}
Code:
function upload_game($game)
{
global $vbulletin, $filename, $thumbdir;
require_once('./includes/class_upload.php');
require_once('./includes/class_image.php');
$upload = new vB_Upload_Image($vbulletin);
$upload->image =& vB_Image::fetch_library($vbulletin);
$upload->path = "./".$thumbdir."/games";
$vbulletin->GPC['upload']['name'] = $game['gameID'].".jpg";
if (!($upload->process_upload($vbulletin->GPC['upload'])))
{
eval(standard_error(fetch_error('there_were_errors_encountered_with_your_upload_x', $upload->fetch_error())));
}
$vbulletin->url = $filename.'?do=games';
eval(print_standard_redirect('redirect_rankgame_edited'));
}
This should work... but I'm getting the following error...
Code:
There was an error encountered with your upload:
This JPEG image has the incorrect file extension.
Any ideas? I am uploading a file called sc4.jpg...