php - move_uploaded_file permission denied on 777 folder -
here error i'm receiving when tried upload via ajax:
move_uploaded_file(/public/assets/uploads/photodune-5351272-asian-traditional-bell-l.jpg): failed open stream: permission denied my uploads folder set 777 using chmod. status of folder:
drwxrwxrwx 2 ec2-user ec2-user 4096 jun 20 10:46 uploads here code i'm using on php side:
if (input::hasfile('file')) { $storefolder = '/assets/uploads/'; if (!empty($_files)) { $tempfile = $_files['file']['tmp_name']; $targetpath = public_path() . $storefolder; $targetfile = $targetpath. $_files['file']['name']; move_uploaded_file($tempfile, $targetfile); echo $targetpath . " / " . $targetfile; } } else { echo "there has been error in creating file"; } why still getting permission denied when trying utilize move_uploaded_file?
for sake of testing, can see fileupload , errors here: http://www.relatient.net/relatientv2/public/portal/upload
for reason, assets folder needed set 775 , laravel had this: ./composer.phar dumpautoload.
after doing this, uploading ok.
php laravel upload
No comments:
Post a Comment