Category : storage

I’m faced a problem since yesterday in my laravel projet. I have a input file and the file is uploaded in the forder storage/app/public/uploads. Now when i want to show the file I have this message: "Access forbidden! You don’t have permission to access the requested directory. There is either no index document or the ..

Read more

There is a table house. It has four columns (where the path to the downloaded file should be saved). I tried to download one file in the controller for the test, but it did not appear in the database $this->validate($request, [ ‘passport’ => ‘required’ ]); $homes = Houses::query()->create([ ‘passport’ => $request->get(‘passport’) ] ); $request->validate([ ‘file’ ..

Read more

I have a Laravel backend project and multiple ReactJS applications accessing to it through API calls. I have no problem with those because I configured config/cors.php to recieve requests to ‘api/‘ from any origin. Also tried to add ‘storage/‘ to paths, but it didn’t work: ‘paths’ => [‘api/*’, ‘storage/*’], ‘allowed_methods’ => [‘*’], ‘allowed_origins’ => [‘*’], ..

Read more

I have a problem with accessing shared network storage from my laravel app. It is mounted into /mnt/nfs/ folder inside my ubuntu server. I can access that folder/storage directly via terminal but when I try to use this folder as root folder for laravel storage. I receive this error: "impossible to create the root directory ..

Read more

I have a weird issue, I just setup a small Laravel project where the user can change it’s picture, I handled it like follows: if ($request->file(‘picture’)) { $file = $request->file(‘picture’); $file->storePubliclyAs(‘/user’, $file->getClientOriginalName(), [‘disk’ => ‘public’]); $user->picture = ‘/storage/user/’ . $file->getClientOriginalName(); } When I checked my database, I got the following in the ‘picture’ column: /storage/user/user.jpg ..

Read more

i completly recode my controller for get name, size of files stored in storage. But problem is how to download files. My code after click the button download file with name HTTP_1.0 200 OK. Whats wrong is with my code ? controller $filesDownload = []; $filesDownloadSize = []; $downloadLink = []; $filesDownloadPath = File::allFiles(storage_path(‘app/Files/’)); foreach($filesDownloadPath ..

Read more

I want to save uploaded file to ‘/home/user/images’ folder. Is there any way to do this? My 1st try: controller public function save(Request $request) { $file = $request->file(‘image’); $file_name = $file->getClientOriginalName(); $file_path = ‘/home/user/images’; $file->move($file_path, $file_name); } ///////////////////// My 2nd try: filesystems.php ‘disks’ => [ .. ‘custom_folder’ => [ ‘driver’ => ‘local’, ‘root’ => ‘/home/user/images’, ..

Read more

I’am using this code to display the image @foreach($Phones as $clothe) @if($clothe->category==’Phones’) <div class="card" style="width: 300px; display:inline-block; margin:20px;"> <img class="card-img-top" src="{{ URL::asset(‘storage/images/’.$clothe->image)}} " width="100%"/> the picture exist on storageapppublicimages but it doesn’t display on my page, btw i’ve made the php artisan storage:link Sourc..

Read more

I am currently have a feature which allows a user to click a button which opens up a PDF to view within the browser but the page keeps displaying a 404. Controller Code $path = ‘public/letters/letter-welcome-‘ . time() . ‘.pdf’; Storage::disk(‘local’)->put($path, $pdf); $url = Storage::url($path); $url = str_replace(‘/storage/’, ‘/public/’, $url); return redirect($url); When i look ..

Read more

I am trying to add logic that allows a user to upload an image which then saves and stores it within the database. The issue is when i upload the image the logo field stores the image as /tmp/phpXhmOZz or fefdndgdggpng when the correct storage should be storage/logos/fd66FT66t63F.png Controller if ($request->logo) { $logo = $request->logo->store(‘public/logos’); ..

Read more

i tried to create a user with email password … and image and multiple images, when I want to upload and store image and multiple images it is very slow, especially large images, what is the right way to solve this problem. protected function validator(array $data) { return Validator::make($data, [ ‘name’ => [‘bail’,’required’, ‘string’,’min:3′, ‘max:50′,’regex:/^[pLs-]+$/u’], ..

Read more

Thank you in advance, I have set up an app.yaml file too after deployment I got file_put_contents(/tmp/framework/sessions/r3SSHndYkTT0CZA2fUhBJ2i28qWj5qjNxdvZj4wB): failed to open stream: No such file or directory error while I have also created tmp folder and it’s subfolder as same as what is inside /storage folder with write permission, but still I am getting above error ..

Read more

I wanting to create a symlink between my sites public storage folder and the public_html folder on my staging environment so i can display logos on the page but i am having issues. Site directory This is my site directory which stores the files for my project /site/public/storage Public html directory /public_html/storage I am wanting ..

Read more

here my code : Storage::disk(‘public’)->putFileAs(‘/img/uploads/specialties’, new File($validatedData[‘image_file’]); In local mode, when i upload an image, they are going into /public/storage/img/uploads/specialties but in production they are going to /storage/app/public/img/uploads/specialties What i tried : $ php artisan storage:link without success. Anyone know how to change where uploaded files going in production ? Thanks ! Sourc..

Read more