jeudi 30 août 2018

Change name of uploading file into s3

I use the below code to store an image to my S3 disk. But using this code i get a random name i.e filename to the image that I'm uploading. So how can i set the filename of $request->renter_proof while uploading? Someone please help.

$storagePath = Storage::disk('s3')
    ->put('/company/'.Auth::user()->company.'/renter-proof/',
          $request->renter_proof,
          'public');

I want the name of the file to be :

$imageName = 'Tag '.$request->input('stock_on_rent').'.'.$request->renter_proof->getClientOriginalExtension();



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire