09-29-2009, 11:38 PM
|
#1 (permalink)
|
|
The Visitor
Join Date: Sep 2009
Posts: 4
Thanks: 3
|
copy(upload/100_0376.JPG) [function.copy]: failed to open
Now this is a new problem. I am trying to upload files. (This PHP application is in the following location on my Mac OS system: ~/Sites/samplesite2
So I am trying to do an upload and this is the error I get:
Notice: Undefined index: ufile in /Users/S/Sites/samplesite2/filebrowser/multiple_upload_ac.php on line 6
Notice: Undefined index: ufile in /Users/S/Sites/samplesite2/filebrowser/multiple_upload_ac.php on line 7
Notice: Undefined index: ufile in /Users/S/Sites/samplesite2/filebrowser/multiple_upload_ac.php on line 8
Warning: copy(upload/100_0376.JPG) [function.copy]: failed to open stream: Permission denied in /Users/S/Sites/samplesite2/filebrowser/multiple_upload_ac.php on line 11
Observations: Is this something to do with file permissions?
I set 777 for filebrowser, Sites, the upload folder, etc.
Or does this whole application go into some other apache2 folder?
Thanks in advance
The file pointed to is below:
<?php
//set where you want to store files
//in this example we keep file in folder upload
//$HTTP_POST_FILES['ufile']['name']; = upload file name
//for example upload file name cartoon.gif . $path will be upload/cartoon.gif
$path1= "upload/".$HTTP_POST_FILES['ufile']['name'][0];
$path2= "upload/".$HTTP_POST_FILES['ufile']['name'][1];
$path3= "upload/".$HTTP_POST_FILES['ufile']['name'][2];
//copy file to where you want to store file
copy($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1);
copy($HTTP_POST_FILES['ufile']['tmp_name'][1], $path2);
copy($HTTP_POST_FILES['ufile']['tmp_name'][2], $path3);
//$HTTP_POST_FILES['ufile']['name'] = file name
//$HTTP_POST_FILES['ufile']['size'] = file size
//$HTTP_POST_FILES['ufile']['type'] = type of file
echo "File Name :".$HTTP_POST_FILES['ufile']['name'][0]."<BR/>";
echo "File Size :".$HTTP_POST_FILES['ufile']['size'][0]."<BR/>";
echo "File Type :".$HTTP_POST_FILES['ufile']['type'][0]."<BR/>";
echo "<img src=\"$path1\" width=\"150\" height=\"150\">";
echo "<P>";
echo "File Name :".$HTTP_POST_FILES['ufile']['name'][1]."<BR/>";
echo "File Size :".$HTTP_POST_FILES['ufile']['size'][1]."<BR/>";
echo "File Type :".$HTTP_POST_FILES['ufile']['type'][1]."<BR/>";
echo "<img src=\"$path2\" width=\"150\" height=\"150\">";
echo "<P>";
echo "File Name :".$HTTP_POST_FILES['ufile']['name'][2]."<BR/>";
echo "File Size :".$HTTP_POST_FILES['ufile']['size'][2]."<BR/>";
echo "File Type :".$HTTP_POST_FILES['ufile']['type'][2]."<BR/>";
echo "<img src=\"$path3\" width=\"150\" height=\"150\">";
?>
|
|
|
|