| | |
Permision issues with uploading files
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2008
Posts: 242
Reputation:
Solved Threads: 19
Hi,
I have created a script to upload files
And that returns OK to the browser allong with my success message but the file doesn't exist, when I look in the sites error log i get
/phptemp/ has CHMOD 777 and apache has read write access to the entire web directory
Whats wrong?
Thanx,
Sam
I have created a script to upload files
php Syntax (Toggle Plain Text)
$filename = $_FILES['Filedata']['name']; $filetmpname = $_FILES['Filedata']['tmp_name']; $fileType = $_FILES["Filedata"]["type"]; $fileSizeMB = ($_FILES["Filedata"]["size"] / 1024 / 1000); //Irrelevant validation here move_uploaded_file($_FILES['Filedata']['tmp_name'], $_SERVER['DOCUMENT_ROOT']."/content/songs/file.mp3");
And that returns OK to the browser allong with my success message but the file doesn't exist, when I look in the sites error log i get
PHP Syntax (Toggle Plain Text)
[Fri Oct 23 09:53:44 2009] [error] [client 192.168.0.1] PHP Warning: move_uploaded_file(Photo on 2009-10-09 at 22.51 #2.jpg) [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: failed to open stream: Permission denied in /var/www/html/development/scripts/open/signup/uploadtest.php on line 25, referer: http://dev-env-1.samrudge.co.uk/account/main [Fri Oct 23 09:53:44 2009] [error] [client 192.168.0.1] PHP Warning: move_uploaded_file() [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: Unable to move '/phptemp/phpTxmy2f' to 'Photo on 2009-10-09 at 22.51 #2.jpg' in /var/www/html/development/scripts/open/signup/uploadtest.php on line 25, referer: http://dev-env-1.samrudge.co.uk/account/main
/phptemp/ has CHMOD 777 and apache has read write access to the entire web directory
Whats wrong?
Thanx,
Sam
Last edited by samarudge; Oct 23rd, 2009 at 6:02 am.
My Blog, Life and everything that matters to me - SamRudge.co.uk
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
•
•
Join Date: Sep 2009
Posts: 527
Reputation:
Solved Threads: 61
0
#2 Oct 23rd, 2009
by the error logs it seems that your code is not able to access the file,check the permissions to that file.sometimes it might be the case that the file is permitted but the folder outside of it not , so check with that too.
Last edited by network18; Oct 23rd, 2009 at 6:08 am.
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
![]() |
Similar Threads
- PHP upload issues - uploading not working on some machines (PHP)
- uploading files with php (PHP)
- Uploading files to mysql (PHP)
- Uploading files Access Denied Error (ASP.NET)
- Dreamweaver ftp issues (Graphics and Multimedia)
- Uploading files using HTTP/X and CGI (Shell Scripting)
Other Threads in the PHP Forum
- Previous Thread: Ajax text to select
- Next Thread: Qn About Tables and Images
| Thread Tools | Search this Thread |
# 5.2.10 alexa apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date directory display dissertation dynamic echo echo$_get[x]changingitintovariable... email encode error fairness file files folder form forms function functions google href htaccess html image images include indentedsubcategory insert ip javascript joomla legislation limit link local login mail memberships menu mlm multiple multipletables mysql mysqlquery newsletters oop open paypal pdf persist php problem provider query radio random recursion remote rss script search server sessions sms sockets source space spam sql syntax system table tutorial update upload url validator variable variables video web youtube





