Jump to content

[SOLVED] error moving image


bfadler

Recommended Posts

I get this error after clicking upload on my form, I've been searching and can't figure it out

 

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php1AAqJD' to 'directory/uploads/images/anyimage.jpg' in /directory/uploads/do_upload.php on line 10

 

heres the code;

 

<?php

$file_dir = "directory/uploads/images";

foreach($_FILES as $file_name => $file_array) {

echo "path: ".$file_array["tmp_name"]."<br/>\n";

echo "name: ".$file_array["name"]."<br/>\n";

echo "type: ".$file_array["type"]."<br/>\n";

echo "size: ".$file_array["size"]."<br/>\n";

 

if (is_uploaded_file($file_array["tmp_name"])) {

move_uploaded_file($file_array["tmp_name"], "$file_dir/".$file_array["name"]) or die ("Couldn't copy");

echo "file was moved!<br/>";

}

}

?>

Link to comment
https://forums.phpfreaks.com/topic/115507-solved-error-moving-image/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.