![]() |
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\">"; ?> |
Couple of things here
|
And you need to use forum tags to wrap your code samples to stop the wall of text crit my eyes have just experienced.
Edit ... GRRRRRRRR damn forum striped out my tags (and I did try to convert the [ ] o html entities), anyway this thread should show what I meant. http://www.talkphp.com/lounge/4563-p...e-talkphp.html |
Thank you. I am implementing those changes.
|
| All times are GMT. The time now is 07:20 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0