lubusIN / laravel-gymie

👨‍💻 Gym & Club Management System https://gymie.in
MIT License
418 stars 247 forks source link

Error when uploading photos #26

Closed fouedmoussi closed 5 years ago

fouedmoussi commented 6 years ago

i am getting this error message when i try to upload profile pic to my user

capture

cracker182 commented 6 years ago

This looks like a permission problem based on you os. Which is the server is running on?

EDIT3: Have trouble too and investigate.

EDIT2: Go to gymie\storage\medialibrary --> rightclick --> security --> add "everyone" with full access rights

Editd: sorry windows I see. check if the storage folder has full wirte access.

fouedmoussi commented 6 years ago

@cracker182 Yes i'm on Windows 10 and i use XAMPP Version: 7.1.14 Includes: Apache 2.4.29, MariaDB 10.1.30, PHP 7.1.14, phpMyAdmin 4.7.7, OpenSSL 1.0.2, XAMPP Control Panel 3.2.2, Webalizer 2.23-04, Mercury Mail Transport System 4.63, FileZilla FTP Server 0.9.41, Tomcat 7.0.56 (with mod_proxy_ajp as connector), Strawberry Perl 7.0.56 Portable

Unfortunately this doesn't solve the problem. PS: i have another laravel project with the same permissons for storage folder and it works fine !

cracker182 commented 6 years ago

Jeah, i'm researching here. seems that it have something to do with windows and Laravel-Medialibrary. Take a look here. I try to figure out a solution.

ajitbohra commented 6 years ago

@MsFoued try giving full write access to storage folder that will solve the permissions issue. Encountered same while using XAMPP on Windows & Linux, giving full write access fixed it.

cracker182 commented 6 years ago

@ajitbohra can not confirm. image still the same issue.

ajitbohra commented 6 years ago

following

fouedmoussi commented 6 years ago

@ajitbohra same here capture

fouedmoussi commented 6 years ago

@cracker182

i tried those 2 instructions : dd(touch('delete.me')); === > return true dd(touch('delete.')) ===> Exception touch(): Unable to create file delete. because Permission denied i think that windows doesn't allow files without extensions

PS : it works fine on Ubuntu

cracker182 commented 6 years ago

@MsFoued yes, had the same result. seems to be a error with the package spatie/laravel-medialibrary. i investigate further.

ajitbohra commented 6 years ago

@MsFoued @cracker182 following will cross-check on windows mission as I remember didn't face the issue though it was long back. If needed will check with guys at spatie for the same.

awolad commented 6 years ago

I have same problem on windows (xampp on local server). Please help me. error

Davisy commented 6 years ago

I have some issues when uploading user photo it show image is not readable capture43

alouini333 commented 6 years ago

I got the same error Actually, windows can't touch() a file without extension. (Don't know why?)

So in the MembersController

The store action

I edited if ($request->hasFile('photo')) { $member->addMedia($request->file('photo'))->usingFileName('profile'.$member->id.$request->photo->getClientOriginalExtension())->toMediaCollection('profile'); } To if ($request->hasFile('photo')) { $member->addMedia($request->file('photo'))->usingFileName('profile'.$member->id.".".$request->photo->getClientOriginalExtension())->toMediaCollection('profile'); }
I just added a dot before the extension

ajitbohra commented 5 years ago

Fixed in 4785302a517590afdfef57aeb67699ccebd3dd04

@alouini333 thanks for catching that