| | |
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: 250
Reputation:
Solved Threads: 20
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: 539
Reputation:
Solved Threads: 63
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 |
action ajax apache api array auto beginner binary bounce broken cakephp checkbox class cms code cron curl database date display domain dynamic echo email error errorlog file files folder form format forms function functions google href htaccess html image include insert integration interactive ip java javascript joomla limit link load login loop mail malfunctioning masterthesis menu mlm multiple mysql nodes oop paypal pdf php popup problem query radio ram random recursion reference regex remote return script search server sessions sms soap source space sql syntax system table tutorial unset update upload url validation validator variable video web websitecontactform xml youtube





