File permission 755 is not set while uploading file on cPanel - php

I have tried many times when I upload my project files on cPanel using zip file with selection 755 permission it set 755 permission only on zip file but not set 755 permission inside zip folder sub files.
I have lot of files and I can't give manually 755 permission because it's lot of files and without 755 permission my projects gives error with 404 Not Found.
I am using this way at the time of file uploading show in below image, so how to give file permission that are located inside zip folder?

zip does not store file permissions in the archive, I think you will have to try this with .tar file instead of .zip.

Related

Laravel Chumper/Zipper Permission Denied while extracting

I just installed Chumper/Zipper to extract zip files which will be uploaded. After upload I want to extract the file.
So I tried this way:
\Zipper::make(storage_path($path . $zip_file))->extractTo($path);
So $path is a folder in my storage folder and the $zip_file is the name of the uploaded file.
If I try to upload now (upload works etc.) im getting the following error message:
mkdir(): Permission denied
I gave the whole laravel project the ownership of non-root user.
Also the $path folder in storage has 0755 rights.

Codeigniter failed to open stream permission when upload images

Code:
$filename = '12345.jpeg';
$source = imagecreatefromstring($imageData);
$imageSave = imagejpeg($source,$filename,100);
imagedestroy($source);
$this->ftp->connect();
$this->ftp->upload($imageSave,'/public_ftp/incoming/'.$filename,'ascii', 0775);
$this->ftp->close();
Error:
Codeigniter failed to open stream permission when upload images.
Probably it is a permissions issue. Try this:
sudo chmod -R 777 path/to/public_ftp/incoming/
However, this will give permission to everyone. For localhost this is ok. But for production environment you should do it in another way. Check this answer for more info
#edit
If you are getting this error when trying to upload a file from a form. codeigniter documentation:
The Upload Folder
You'll need a destination folder for your uploaded images. Create a
folder at the root of your CodeIgniter installation called uploads and
set its file permissions to 777.
Do you have this folder with permissions set to 777?

PHP::FTP Change file permission

Im doing php pipe email functionality i am able to upload file from email and i am uploading file(jpg,png..) in my folder.
problem is when access that file from FTP or Browser that file not opening. and uploaded files permissions code default showing 600 and "-rw----" and owner/group showing 99 99.
i need to change permissions to 644 and 502 100.
in my script i used:
chmod("/var/www/html/quantumcrew/blogpdf/",0777);
how can i change owner permissions from my script(mail pipe script).
To change ownership you would need to use chown. http://php.net/manual/en/function.chown.php
chown("/var/www/html/quantumcrew/blogpdf/", 502);

Ftp craeting folder and setting permission with php

I am making uploading site that creates folder for each user to store his pics in , i tried to make the folder with the php normal function mkdir and setting the permissions to 0777 it's creating the folder but i cant add files from the php program only copying through windows explorer in the ftp server , but if i made the folder through ftp server and set the permissions manually it worked and uploaded pics , so i tried the ftp_mkdir with the following code :
$uploaddir="httpdocs/pics/".$uid.$uname;
if(!is_dir ($uploaddir))
{
ftp_mkdir($conn, $uploaddir);
ftp_chmod($conn,"0777", $uploaddir);
}
ftp_close($conn);
it's creating the folder but not with full permissions so you cant upload files to the folder until you set the permissions manually then it works fine

Ftp folder permission not granted

I have ftp server which store my websites uploaded files. I am putting uploaded images into "upload" directory and then displaying on them to webpages with link to my photo editor tool.
Some how I can not access my ftp files in my photo editor. I figured that it is permission problem, but when I go to change permission for my upload directory files it fails to changes and says
"CHMOD 777 realtors.jpg: Operation not permitted."
let me know if any idea on how to solve this.

Categories