How can we Create custom name while uploading image using storage?

0 votes

Image operations tend to be quite memory exhausting because image handling libraries usually 'unpack' all the pixels to memory. A JPEG file of 3MB can thus easily grow to 60MB in memory and that's when you've probably hit the memory limit allocated for PHP.

Check your php.ini and increase the memory limit, e.g.:

memory_limit = 512MB

How can we do that by piece of code in laravel?

Mar 26 in Laravel by kartik
• 4,380 points
13 views

1 answer to this question.

0 votes

Hello,

You also can do like this

$ImgValue     = $request->service_photo;
$getFileExt   = $ImgValue->getClientOriginalExtension();
$uploadedFile =   time()'.'.$getFileExt;
$uploadDir    = public_path('UPLOAS_PATH');
$ImgValue->move($uploadDir, $uploadedFile);

This is really a simplest way to save file inside public directory :) But I think you want to achieve this using default Storage. 

Hope this work 

Thank you!!

answered Mar 26 by Niroj
• 8,220 points

Related Questions In Laravel

0 votes
1 answer

How can we use the custom table in Laravel?

Hey, We can easily use custom table in ...READ MORE

answered Mar 20 in Laravel by Niroj
• 8,220 points
22 views
0 votes
1 answer

How can we use controller once it was created successfully?

Hey kartik You can  first refer how to  ...READ MORE

answered Mar 18 in Laravel by Niroj
• 8,220 points
18 views
0 votes
1 answer

What is middleware? How can we register middeleware in Laravel?

Middleware acts as a bridge between a ...READ MORE

answered Mar 18 in Laravel by Niroj
• 8,220 points
58 views
0 votes
1 answer

How can we Disable CSRF Laravel?

Hello, You can disable CSRF Laravel from the App/Http/Kernel.php file ...READ MORE

answered Mar 19 in Laravel by Niroj
• 8,220 points
24 views
0 votes
1 answer

How to download and install Lavavel framework?

Hey @kartik, First you must have xampp install ...READ MORE

answered Mar 17 in Laravel by Niroj
• 8,220 points
25 views
0 votes
1 answer

Display Laravel in browser by using cmd promt?

Hello, First you need to have laravel install ...READ MORE

answered Mar 17 in Laravel by Niroj
• 8,220 points
17 views
0 votes
1 answer

How can we get started with Laravel through Xampp?

Hii, First you need to start Apache and ...READ MORE

answered Mar 17 in Laravel by Niroj
• 8,220 points
18 views
0 votes
1 answer

How to change Laravel official name to any customize name?

Hey, You just need to go Laravel folder through ...READ MORE

answered Mar 17 in Laravel by Niroj
• 8,220 points
11 views
0 votes
1 answer

How can we create a record in Laravel using eloquent?

We need to create a new model ...READ MORE

answered Mar 20 in Laravel by Niroj
• 8,220 points
27 views
0 votes
1 answer

How can we Create Multiple Where Clause Query Using Laravel Eloquent?

Hii, You can use Conditions using Array: $users = User::where([ ...READ MORE

answered 3 days ago in Laravel by Niroj
• 8,220 points
16 views