Category : file

I was testing my delete function but how do I integrate it to a button Here is the code profile.blade <div class="modal-body">Select the delete button to continue</div> <div class="modal-footer"> <button class="btn btn-primary" type="button" data-dismiss="modal">Cancel</button> <button class="btn btn-secondary"type="button" href="/delete">Delete</a> </div> </div> This is where I wanted to use the function Here is the routes <?php /* ..

Read more

in my application, I am trying to upload one same file to two different paths inside a foreach loop. but it uploads the file to the first location and when uploading to the other it throws the below error. "The file "image.jpg" was not uploaded due to an unknown error." below is my controller function: ..

Read more

I have an issue while showing the file in browser. Generally I have pdf file to show (may be other). So first here is my code — header(‘Content-Description: File Transfer’); header(‘Content-type:application/pdf’); // $filename = "myfile.pdf; // header(‘Content-Disposition: inline; filename=’ . $filename); // header(‘Content-Transfer-Encoding: binary’); // header(‘Expires: 0’); // header(‘Cache-Control: must-revalidate’); // header(‘Pragma: public’); // header(‘Content-Length: ..

Read more

I have a function the program is generating a .csv file, and after I want to download in the browser. The problem is: when the function is called, the file is displaying in the browser instead of downloading it. Any suggestion? $csv=array($index,$value); $filename=’persons.xls’; $handle=fopen(‘persons.xls’, ‘w’); $headers = [‘Content-Type: text/xls’]; foreach ($csv as $row) { fputcsv($handle, ..

Read more

what happen to my update file? I can’t update file in my program, what’s wrong with my controller? edit.blade.php <div class="row"> <div class="col-12"> {{ Form::model($activityreports,[‘route’=>[‘activityreports.update’,$activityreports[‘id’]], ‘files’=>true, ‘method’=>’GET’, ‘enctype’=>’multipart/form-data’]) }} <div class="card"> <div class="card-body"> @if(!empty($errors->all())) <div class="alert alert-danger"> {{ Html::ul($errors->all())}} </div> @endif <div class="row"> <div class="col-md-6"> <div class="form-group"> {{ Form::label(‘file’, ‘Laporan Kegiatan’) }} {{ Form::file(‘file’, [‘class’=>’form-control’]) ..

Read more

I cannot upload multiple images in my Laravel + vue js project.. here is my code below my vue conponent <form @submit.prevent="addProduct" enctype="multipart/form-data"> <div class="form-group"> <div class="row"> <div class="col-lg-4"> <label for="product_image">Product Image:</label> </div> <div class="col-lg-4"> <input type="file" name="pics[]" id="product_image" @change="fieldChange" multiple> <has-error :form="form" field="product_image"></has-error> </div> <div class="col-lg-4"> <img :src="form.product_image" height="70px" width="85px" alt=""> </div> </div> </div> ..

Read more

I have a link for example "https://www.example.com/example-811.jpg" I need to upload it to laravel storage (../app/storage/public/). This is the maximum that I could implement in the controller, everything is fine, but the files are loaded in the TMP extension, how can I load the file in the required format? $filename = ‘example-811.jpg’; $tempImage = tempnam(‘..storageapppublic’, ..

Read more

I am developing a file system management using laravel 8. I created a function that accept file. public function uploadExperiment(Request $request) { $file = $request->file(‘file’); $uniqueId = time(); $fileName = $file->getClientOriginalName(); $filePath = $uniqueId . ‘/’ . $fileName; Storage::disk(‘local’)->put($filePath, file_get_contents($file)); return response()->json(["success"=>true]); } I need to track the uploaded size during the uploading process and ..

Read more

It’s working with inputs and dates puttin’ "value", but don’t with selectboxes and files. edit.blade.php <select type="text" name="Fequency_Id" value="{{$frequencyData->getFrequencyNumber()}}"> <option>Seleccionar</option> @foreach ($frequency as $data) <option value="{{$data->getFrequencyId()}}"> {{$data->getFrequencyNumber()}} </option> @endforeach </select> <input type="file" name="qr_code_machine" value="{{asset(‘storage’).’/’.$machine->getQrCodeMachine()}}"> I’ve testing verifying if they’re empty but it doesn’t work. Sourc..

Read more

I have a problem for many file uploads with the request structure for the file variables in an array. the following is the code snippet. i need a solution for this, thanks $cimage = count($request->variant[$loop][‘img’]); for($loops1 = 0; $loops1 < $cimage; $loops1++) { $variantImage = $request->file($request->variant[$loop][‘img’][$loops1]); $nameVariantImage = $variant->id . ‘-‘ . date(‘ymdHis’) . ($loops1 ..

Read more

I want to upload multiple files in laravel with metadata. Like file custom name and file category. I tried to add some property in frontend using js but I can see them in the controller here the code $(document).on(‘change’,’#file’,function(e){ let file = e.target.files[0] file.totalWords = 1234; file.caytegory = ‘category’; filesList.push(file) }); let mainFormData = new ..

Read more

I’m working with vuejs and want to submit files using axios I try to append files to FormData but it still not working The only thing I know how to do is showing the file’s name <template> <div> <div class="row"> <div class="col-lg-9 col-md-9 col-sm-12"> <div class="form-inline mb-3 pt-3"> <label for="date">Date:</label> <input type="date" name="date" id="date" min=’2020-05-08′ ..

Read more

I have this issue when I try to show the name in my public view {{$boletin->url}} and show me this: [{"download_link":"boletinesDecember2020Hpxj1lGpxXi8f5tTeOld.pdf","original_name":"C_PROCESO_20-12-11135698_250001015_78680742.pdf"}] and I cant download the file recently uploaded. this is my code: url}}” download=”{{explode(‘.’,$boletin->url)[0]}}” class=”btn btn-success”>Descargar the thing is that in the admin voyager show me very good I hope someone can help me ..

Read more

When I run in my local, the image file is shown. But in the production server it is not showing. URL in my local : http://localhost:8000/files/image/GOT7.jpg URL in my production server : http://myApplication.com/files/image/GOT7.jpg .env in the local : APP_URL=//localhost .env in the production server : APP_URL=https://myApplication.com config/filesystem.php ‘disks’ => [ ‘local’ => [ ‘driver’ => ..

Read more