Category : file-upload

The banner image is stored in database. The location of image uploaded in public/uploads/banners. This is banner image controller: public function store(Request $request) { $data = new BannerImage; $this->validate($request, [ ‘banner_title’ => ‘required’, ‘banner_subtitle’ => ‘required’, ‘image’ => ‘image|nullable’, ]); if($request->hasFile(‘image’)) { // dd("success"); $file = $request->file(‘image’); // dd($file); $extension = $file->getClientOriginalExtension(); $filename = time(). ..

Read more

I got error with Call to a member function move() on null at $request->file->move(‘storage/’. $filename); $application = new Application; if($request->file(‘proposal’)){ $file=$request->file(‘proposal’); $filename=time().’.’.$file->getClientOriginalExtension(); $request->file->move(‘storage/’. $filename); $application->file= $filename; } <form class="form-horizontal" action="{{route(‘application.store’)}}" enctype="multipart/form-data" method="POST"> …….. <input type="file" name="application_proposal"> </form Sourc..

Read more

I got error in my error message alert that said my file is fail to upload I tried to store my file inside the database. This is what I have tried. blade <form class="form-horizontal" action="{{route(‘user.application.store’)}}" method="POST" enctype="multipart/form-data"> <div class="form-group row"> <label for="proposal" class="col-sm-2 col-form-label">File</label> <div class="col-lg-10"></label> <input type="file" id="proposal" name="proposal" required="required"><br/> </div> </div> controller public ..

Read more

My project is in a subfolder /example-domain.com/public_html/v1/ where the folder v1 is the root of my Laravel project. I followed this tutorial from https://laravel.com/docs/7.x/filesystem#the-public-disk and created a symbolic link from v1 folder. Then I do some uploading and manage to get the file uploaded in this path /storage/app/public/cars/. Here is my code $file = $request->file(‘image’); ..

Read more

I upload a file In my controller, I did this $file = Input::file(‘file’); dd($file); I see this IlluminateHttpUploadedFile {#1388 ▼ -test: false -originalName: "config-nsd-got.yaml" -mimeType: "application/x-yaml" -error: 0 #hashName: null path: "/private/var/tmp" filename: "phpb73hcy" basename: "phpb73hcy" pathname: "/private/var/tmp/phpb73hcy" <<<<<<———- I WANT TO ACCESS THIS extension: "" realPath: false writable: false readable: false executable: false file: ..

Read more

Description I have a form, that I used to upload .yaml file that contain these nsd: name: F-FortiGate description: F FortiGate KVM64 vendor: Benu version: ‘1.0’ constituent-vnfd: member-vnf-id1: fortiGate As soon as I upload, and capture the packet, I see that the content getting malformed to look something like this ————————–c861a90dcb2a5d6c Content-Disposition: form-data; name="file" @ ..

Read more

I have a small app where I can can upload multiple files one by one (not at once) but for some reason, each time I upload a file, the other one just disappears. As shown in the screenshots below : If I `dd($request->all());, only one file is listed. Here’s my controller : public function profileUpdate(Request ..

Read more

This is my form: <div class="form-group"> <label for="image_one">1st Product Image:</label> <input type="file" class="form-control" id="image_one" name="image_one" placeholder="image"> </div> <div class="form-group"> <label for="image_two">2nd Product Image:</label> <input type="file" class="form-control" id="image_two" name="image_two" placeholder="image"> </div> <div class="form-group"> <label for="image_three">3rd Product Image:</label> <input type="file" class="form-control" id="image_three" name="image_three" placeholder="image"> </div> and this is my controller: if ($request->hasFile(‘image_one’)) { $file_one = $request->image_one; $extension_one ..

Read more

I need help , i have working with react native and api laravel to upload image but not uploading ? this my react native code var dataphoto = this.state.photoData; // this from ImagePicker RNFetchBlob.fetch(‘POST’, ‘my_url/api/storimage’, { Authorization : “Bearer access-token”, otherHeader : “foo”, ‘Content-Type’ : ‘multipart/form-data’, }, [ { name : ‘image’, filename : ‘image.jpg’,type:’image/jpg’, ..

Read more

I have a generic upload API, that store uploaded image as a blob in database. A user might upload profile pic, documents, etc. so there are various use cases. Users accessing these API are different in terms of access level. After uploading, the logic would change like where the uploaded file should be mapped or ..

Read more