shem's avatar
Level 1

trying to upload file to public folder but am getting server error

            foreach ($request->file('files') as $uploadedFile) {
                $filename = $uploadedFile->store('uploads');
                // echo $filename;
                $file = new File();
                $file->applicationId = $request->applicationId;
                $file->path = $filename;
                $file->status = 0;
                $file->year = date('Y');
                $file->save();
            }
        }```
this works on a local machine but when hosted online it returns server error
0 likes
4 replies
shem's avatar
Level 1

still not working after changing the permission of storage file to 777

Sinnbeck's avatar

Check your logs then. Start with laravel.log in storage/logs

Please or to participate in this conversation.