someoneneedshelps
Technical User
I'm using the method below to copy an image from one directory to another on the fly, the thing is, when I use the move_uploaded_file method it doesn't see the image...
I have to click refresh on the server then the image appears in the FROM directory but the move method must not be able to see it? any help please?
this is the move file method,
the directory is also made on the fly but that does appear
I have to click refresh on the server then the image appears in the FROM directory but the move method must not be able to see it? any help please?
Code:
$doc_root= $_SERVER['DOCUMENT_ROOT'];
$image_upload_path = $doc_root . '/imagedump/';
$image_name = 'img-' . time() . '.jpg';
$destination = $image_upload_path . $image_name;
$data = file_get_contents($imgstr);
$file = fopen($destination, "w+");
fputs($file, $data);
fclose($file);
this is the move file method,
Code:
move_uploaded_file($destinationfrom, $upload_path . $auction_id . '/' . $image, false);
the directory is also made on the fly but that does appear
Code:
mkdir($upload_path . $auction_id, 0777);