Hi Guys,
I'm trying to make an image upload through flash, and resize it in the php, but for some reason the file doesnt get copied within the server, see the code below
Code: Select all
$imageDirectory = "Common/Media/Images";
// EXECUTING
//-------------------------------------------------------------------------
if(!is_dir($imageDirectory)) mkdir($imageDirectory, 0755);
$fileNames = $_FILES['Filedata']['name'];
$uniqueId = "Common/Media/Images/".$_GET['fileId'].".jpg";
$imageFile = $uniqueId;
// Get new sizes
list($width, $height) = getimagesize($_FILES['Filedata']['tmp_name']);
$newwidth = 640;
$newheight = 480;
// Load
$new = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($_FILES['Filedata']['tmp_name']);
// Resize
imagecopyresized($new, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Output
imagejpeg($new, $imageFile);but when i use
Code: Select all
move_uploaded_file($source, $imageFile);the file get copied, any reason why?
Thanks