Laravel Chumper/Zipper Permission Denied while extracting - php

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.

Related

Access PDF Without making it Public

I have made a file uploader to upload DOC/PDF Files, When the user uploads the file files the default permission is 644, With that when the user who uploaded the files gets Permission denied error when he access the file.
I make it accessible by setting the permission to 777. but that is not secure.
Is there any other way to access PDF without 777 permission?

File permission 755 is not set while uploading file on cPanel

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.

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?

Permission denied when saving image in php webservice on Windows

First, this is the first time i code both of web service and android (normally just android), so please bear with me.
I tried to upload an image to the mysql (phpmyadmin) through the Codeigniter-based webservice. The image column in mysql (phpmyadmin) is BLOB.
$data['image'] = str_replace('data:image/jpg;base64,', '', $data['image']);
$data['image'] = str_replace(' ', '+', $data['image']);
$decoded= base64_decode($data['image']);
Then save the decoded file (this is where the permission is denied) :
file_put_contents('C:\xampp\htdocs\project\images', $decoded);
The image file should be saved in the "temp" folder, which is in the same folder with the php file (controller folder). However, the file is never stored (but the other data like name, email is stored on the mysql).
The error i got :
<p>Message: file_put_contents(C:\xampp\htdocs\project\images): failed to open stream: Permission denied</p>
Im kinda stuck now. Please kindly help me.
Thanks for your help
As per the error I think that the images directory must have the Read-Write Permission, so that images can be stored into it.
You can give 777 permission to the images folder. If you want to give then type the following code in the terminal
sudo chmod -R 777 path
Please take care you give permission to only images folder, and not the other folders

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