$filename = generate_filename($type, $id);
$filepath = "gs://$bucket.appspot.com/uploadedfiles/$filename";
error_log("trying to move ".$_FILES['image']['tmp_name']." to ".$filepath);
if (file_exists($_FILES['image']['tmp_name'])) {
if (move_uploaded_file($_FILES['image']['tmp_name'], $filepath)) {
// ...
} else {
error_log("could not move the uploaded file");
}
}
This is what I'm seeing in the log:
trying to move /tmp/php69rSck to gs://my-project.appspot.com/uploadedfiles/sale-image-3-1545631667.1964.jpg
could not move the uploaded file
How can I determine why this is failing?