Category : upload

Hi I’m using unisharp laravel-filemanager for user to upload their products photos when the image uploaded this address will save in database /photos/44/606074649c651.jpg and I can use it by {{asset(‘storage/’.$product->cover_img)}} and Thumbnail saved in this address /photos/44/thumbs/606074649c651.jpg How can I get the address of thumbnail and how can I use it in blade? Sourc..

Read more

Laravel Version: 8.35.1 PHP Version: 8.0.0 Description: I’m uploading an image with laravel using this code: $product_image = $request->file(‘product_image’); $product_image_extension = $product_image->extension(); $product_image_name = time() . ‘.’ . $product_image_extension; $product_image->storeAs(‘/media/product_images’, $product_image_name); $model->product_image = $product_image_name; It works fine, the file is uploaded to storage/app/media/product_images/. Then, I run the command php artisan storage: link to create the ..

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 try to upload file inside my /public/images/profils directory but, i don’t know why, it’s not working ! this is my controller function : if ($request->hasFile(‘image’)) { if ($request->file(‘image’)->isValid()) { $validated = $request->validate([ ‘image’ => ‘mimes:jpeg,png|max:2000’, ]); $extension = $request->file(‘image’)->extension(); $name = uniqid(‘img_’); $request->file(‘image’)->storeAs(‘/public/images/profils’, $name.’.’.$extension); } } When i check on the folder, no file ..

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 want upload image to server and display it in the list. I expect to use the same function ‘addProduct’ to store image (title & description were successfull). Got file is empty message in the backend. I have googled a lot, nothing solved my problem. Sorry I am not experienced in programming. thanks for help ..

Read more

I started creating an e-commerce platform and I’m stuck with a problem I can’t solve for 2 days.. It’s probably something obvious but I just can’t find the solution for this. Could you help me with this, please? I get this error: Missing required parameters for [Route: images.update] [URI: dashboard/images/{image}]. (View: C:xampphtdocsecommerceecommerceresourcesviewswebsiteadminproduct_imageupdate.blade.php) update.blade.php @extends(‘website.admin.layouts.main’) @section(‘content’) ..

Read more

I don’t understand how I can send a response to avoid Heroku’s server error when uploading files that exceed 20mb. I am using PHP 7.4/Laravel 8.x and I am receiving, heroku[router]: sock=backend at=error code=H18 desc="Server Request Interrupted" method=POST An H18 signifies that the socket connected, some data was sent as part of a response by ..

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

trying to upload an image at laravel: On echo $request; i am getting this: POST /infoshore0/api/public/v1/product/addProductImg?lang=en-us HTTP/1.1 Accept: application/json, text/plain, */* Accept-Encoding: gzip, deflate, br Accept-Language: en-IN,en-GB;q=0.9,en-US;q=0.8,en;q=0.7 Authorization: Bearer eyJ0eXAiOiJKV1QiLNjc0MTcsIm5iZiI6MTYwMjI2MzgxNywianRpIjoiZmxhdHJ1Mk5BeGdLc0JWRCJ9.lFcZOOSZx_94eZY97L-OfR36XLX_KLqvbZFJo5l2FW8 Connection: keep-alive Content-Length: 209141 Content-Type: text/plain;charset=UTF-8 Cookie: laravel_session=7dab0a4fdba93fbec911f Host: localhost:8080 Origin: http://localhost:8080 Referer: http://localhost:8080/cp/ Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin User-Agent: Mozilla/5.0 (Windows NT 10.0; ..

Read more

i have a form to store image in database but i get error "Call to a member function getClientOriginalExtension() on null" my form.blade.php <form method="POST" action="{{ ‘/admin/data/list’ }}" enctype="multipart/form-data"> @csrf <div class="form-group"> <label for="gambar">Gambar Berita</label> <div class="input-group"> <input type="file" name="gambar" id="gambar"> </div> @error(‘gambar’) <div class="alert alert-danger"> {{ $message }} </div> @enderror </div> </div> <!– /.card-body ..

Read more