#### 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 /* ..

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: ..

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: ..

i am trying to upload a file while register in laravel 8 when the uploaded file is named in English it will continue the register but if the uploaded file named in Arabic letters the form won’t accept that, what is the solution for this problem? $request = request();$profileImage = $request->file(‘uploadfile’);$profileImageSaveAsName = time() ..

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 So , there’s a machine where i have some files, and i would like to access those files from my Laravel project that is running locally. This machine is on an example host like 10.0.101.11 , how can i access this with my laravel project? My filesystem.php disks ‘disks’ => [ ‘ftp’ => [ ‘driver’ .. Read more Currently, I’m facing an issue of reading a file that contains non-English characters. I need to read that file line by line using the following code: while(!feof($handle)) { $line = fgets($handle); } The case is this file has 1711 lines, but the strange thing is it shows 1766 lines when I tried traversing that file. ..

[][1] Here is my file path when I want to add my custom.css file in the head tag my site show in browser blank and when I cut this link browser show content structure without style. I am a new learner of laravel please help me https://i.stack.imgur.com/Zu5Hd.png https://i.stack.imgur.com/IU4mi.png Sourc..

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’]) ..

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> ..

I am modifying an uploaded pdf with Fpdi, in laravel. The pdf is generated perfectly, I can see it in any file explorer. But laravel built in Storage::exists() returns false. It is a pretty weird error, because php file_exists method can find the file perfectly with the same path. I am completely out of ideas. ..

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’, ..

I’m working on a Laravel application. I deploy it with Github Actions based on this article. I set up a GitHub repository with three branches: master: this is where I work production: when I push my master to production, a GitHub action is triggered. This action runs npm run production and generates CSS files. deploy: ..

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 I’m trying to get request from my api client , in my request has items each item should have image witch is file ,how can I save image when I’m loop in items? my item data like so : items:[ { "image" : "1.png" } ] That is my data , of course in my .. Read more I want to validate a file upload but with literally any validation rule, I get "The (name of input) failed to upload." I’ve seen this issue in a few places but none of the solutions worked for me. I’m using Laravel 8.0, php 8.0.2, and nginx/1.18.0 on ubuntu. Controller: public function uploadMedia (Request$request) { ..

I have a form with an input of type file hidden. An image tag works as the clickable trigger to select the file itself, with js to trigger it (that works), but I want to automatically make a PUT request as one chooses an image instead of having to click a submit button on the ..

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..

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 ..

in my application I have multiples files in a folder, now I need to get the name of each file. I could get the all files but when looping through the files to get the file name. I get an error saying ‘Call to undefined function AppHttpControllersfilename()’, how can I get the file names from ..

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′ ..

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 ..