PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: Posting Code in the Forums to learn how to do it too.
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
echo 'Upload result:<br>'; // At least one symbol should be sent to response!!!
$uploaddir = dirname($_SERVER['SCRIPT_FILENAME'])."../gallery/".$_GET['album']."/";
$target_encoding = "ISO-8859-1";
echo '<pre>';
if(count($_FILES) > 0)
{
$arrfile = pos($_FILES);
$uploadfile = $uploaddir . iconv("UTF-8", $target_encoding,basename($arrfile['name']));
if (move_uploaded_file($arrfile['tmp_name'], $uploadfile))
echo "File is valid, and was successfully uploaded.\n";
}
else
echo 'No files sent. Script is OK!'; //Say to Flash that script exists and can receive files
echo 'Here is some more debugging info:';
print_r($_FILES);
echo "</pre>";
?>
does anyone have any idea how i could implement a image reducer into this script, to 600 * 600. tried editing it from snippets i have and have no luck..
thanks..
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: Posting Code in the Forums to learn how to do it too.
$_POST["{$var_prefix}icon"] = $icon_upload_path."/".$_FILES["{$var_prefix}icon"]["name"];
$image = new hft_image($_POST["{$var_prefix}icon"]); // set class to open uploaded file
$image-> resize($max_icon_height, $max_icon_width, '-'); // resize the image
$new_file = $icon_upload_path."/".time().$_FILES["{$var_prefix}icon"]["name"];
$image-> output_resized($new_file,$save_image_as); // save the resized image