Category : file-upload

I am trying to get the exact uploaded image size by using getimagesize() php helper on Laravel 7. But i get an error ErrorException: Undefined property: IlluminateHttpUploadedFile::$name on the line where the code is: if($request->file(‘image’) != null){ $upload = $request->file(‘image’); $sourceProperties = getimagesize($upload->name); Please help understand the issues since it only occurs on the Debian ..

Read more

Please note that each app is hosted on a different server I’m having a form like this (this is just the most important part of the code not all of it to simplify the problem) <b-form name="import" @submit.prevent="importExcel" inline> <b-file id="fileUpload" name="users" :state="Boolean($v.form.usersFile.required)" @change="onFileChange" accept=".xls, .xlsx"/> </b-form> methods: { onFileChange(e){ //console.log(e.target.files[0]); this.form.usersFile = e.target.files[0]; console.log( ..

Read more

Please note that each app is hosted on a different server I’m having a form like this (this is just the most important part of the code not all of it to simplify the problem) <b-form name="import" @submit.prevent="importExcel" inline> <b-file id="fileUpload" name="users" :state="Boolean($v.form.usersFile.required)" @change="onFileChange" accept=".xls, .xlsx"/> </b-form> methods: { onFileChange(e){ //console.log(e.target.files[0]); this.form.usersFile = e.target.files[0]; console.log( ..

Read more

I am trying to upload image from angular(frontend) to laravel(backend). ANGULAR Project product.component.html <form [formGroup]="mediaFormGroup" (ngSubmit)="onSubmit();"> <input type="file" name="thumb_nail" (change)="onFileChange($event,’thumbnail’)" /> <button type="submit" >UPLOAD</button> </form> product.component.ts thumbFile: File; onFileChange(event, imgType) { this.thumbFile = <File>event.target.files[0]; } onSubmit(){ const formData = new FormData(); formData.append(‘thumbimage’, this.thumbFile); this.uploadService.upload(formData).subscribe( data => { return data; }); } upload.service.ts public upload(data) { ..

Read more

I can upload file image in my local, but can’t upload in the production server. the error message that i got in the server : ErrorException in AttachableTrait.php line 125: Non-static method IlluminateLogWriter::error() should not be called statically my function in the AttachableTrait.php: public function processAttachment() { try { foreach (array_keys($this->getAttachableFields()) as $field) { $dirpath ..

Read more

My current functionality allows adding multiple images, the problem I get is that if the user presses the image loading button again, it replaces the previous ones. How would be the way to allow the user to add more images to the gallery? View: <input wire:model="imagenes" type="file" name="imagenes" accept="image/*" class="form-control-file" multiple> Component: foreach ($this->imagenes as ..

Read more

I’m new to Laravel. I can do normal addition. But I cannot add files. What is the problem? blade.php {!!BootForm::open([ ‘method’ => ‘POST’, ‘route’ => ‘admin.companies.postCreateCompany’, ‘files’=> ‘true’])->enctype(‘multipart/form-data’) !!} {!!BootForm::text(‘Company Name’, ‘company_name’, null, [‘required’ => ”, ‘placeholder’ => ‘Company Name’])!!} {!!BootForm::text(‘Name’, ‘owner_firstname’, null, [‘required’ => ”, ‘placeholder’ => ‘Name’])!!} {!!BootForm::text(‘Lastname’, ‘owner_lastname’, null, [‘required’ => ”, ..

Read more

I am trying to use Intervention image with Livewire to reduce the sizes and I am not succeeding. They can guide me or tell me if Livewire may not allow it. I am trying to pass this methodology: foreach ($this->imagenes as $pathGaleria) { $imgUrl = $pathGaleria->store(‘imagenesPropiedades’); $img = imgPropiedades::create([ ‘url’ => $imgUrl, ‘property_id’ => $this->propiedadId ..

Read more

This is the front view of my home page. home page When i upload a.csv type file it will store in a migration table call "project" with 4 columns(id,name,created date,updated date).I want to fill the table in home page by addressing {$project->id}.Is there any possibility to do this without using maatwebsite package. http/controllers/UploadFileController.php <?php namespace ..

Read more

I’m loading multiple images and sometimes it works fine and another hangs, other times it doesn’t take certain images and redirects me to page 404. I would like if you can give me a hand. I appreciate very much any intention. I am using Livewire as follows: <input wire:model="imagenes" type="file" name="imagenes" class="form-control-file" multiple> Once the ..

Read more

I’m using filepond to upload my files to the server using Laravel filepond Backend package. Filepond upload files Asynchronously using XMLHttpRequest. Getting 422 (unprocessable entity) Error in console. Below is my configuration: FilePond.registerPlugin( FilePondPluginFileEncode ); FilePond.create(document.querySelector(‘input[type=”file”]’)); FilePond.setOptions({ server: { url: ‘/filepond/api’, process: ‘/process’, revert: ‘/process’, headers: { ‘X-CSRF-TOKEN’: $(‘meta[name=”csrf-token”]’).attr(‘content’) } } }); FilePond.parse(document.body); <html lang=”en”> ..

Read more

I’m using filepond to upload my files to the server using Laravel filepond Backend package. However, while uploading files using Filepond Asynchronously using XMLHttpRequest. I noticed the following error pops up in the console. Getting 422 (unprocessable entity) Error in console. Below is my configuration: FilePond.registerPlugin( FilePondPluginFileEncode ); FilePond.create(document.querySelector(‘input[type=”file”]’)); FilePond.setOptions({ server: { url: ‘/filepond/api’, process: ..

Read more

I am trying to upload a file with angular and laravel. here is the code for the http request, public submitRequest(data): Observable<any> { console.log(data); return this.http.post(`${environment.apiUrl}/create/`, data, { }); } now, the console.log above has the file attached gallery: Array(1) 0:file: File {name: "Screenshot 2020-05-18 at 2.53.26 PM.png", lastModified: 1589806411978, lastModifiedDate: Mon May 18 2020 ..

Read more