PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
hi there, my friend wrote a scitpt for me along time ago to upload photos. i have changed it slightly to do my new job. The is the script below. can anybody tell me why its giving this error -
Warning: copy(users/whatever_image_i_uploaded.jpg): failed to open stream: No such file or directory in /home/madashat/public_html/eric/mpupload.php on line 26
There was an error adding the pics
The folder users is created and permissions are set to 777
Warning: copy(./users/1.jpg): failed to open stream: No such file or directory in /home/madashat/public_html/eric/mpupload.php on line 26
There was an error adding the pics
Warning: copy(http://eric.madashatters.com/users/1.jpg): failed to open stream: HTTP wrapper does not support writeable connections. in /home/madashat/public_html/eric/mpupload.php on line 26
There was an error adding the pics
Warning: copy(/home/madashat/public_html/ericusersDIRECTORY_SEPERATOR1.jpg): failed to open stream: Permission denied in /home/madashat/public_html/eric/mpupload.php on line 26
There was an error adding the pics
Even though the permissions are correct (set to: 777)
I believe your error is saying that the original copy of the image should reside in users/ and it can't find it. When you upload a file it goes to a tmp location, and then should be moved to a permanent location.
foreach($_FILES AS $k => $v)
{
$tmp_name = $_FILES['pic']['tmp_name'][$k];
// continue using $k in place of $i
}
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Warning: copy(/home/madashat/public_html/user/hair2.jpg): failed to open stream: No such file or directory in /home/madashat/public_html/eric/mpupload.php on line 26
There was an error adding the pics
Definately sounds like a relative path problem. Either way, in your latest error message the directory in the error message was "user" and in your script you have $dest = "users"
dunno if u changed the directory or not, but user != users
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.