Re: How to implement it with my existing code using move_uploaded_file

See all posts Reply

Re: How to implement it with my existing code using move_uploaded_file new!
by Chris, 4 years, 1 month ago
I have already an image uploader but I want to implement this class.upload

$newname= (rand(1, 99999999999).".".$file_ext);		
$dir_separator = DIRECTORY_SEPARATOR;
$folder = "uploads";

$uploaddate = date("M-d-Y");

$destination_path = dirname(__FILE__).$dir_separator.$folder.$dir_separator.$uploaddate.$dir_separator;

if(!is_dir($destination_path)) mkdir($destination_path);

$target_path = $destination_path.$newname;
move_uploaded_file($file_tmp, $target_path);
if(empty($file_name) == false){
  $file_location = "/".$uploaddate."/".$newname;
} else { 
  $file_location = "";
}

So, from this code how can I implement/adjust this?Reply
Re: How to implement it with my existing code using move_uploaded_file new!
by colin, 4 years, 1 month ago
Please see the documentation. You need to replace move_uploaded_file with the class.Reply