MorganC3's avatar

Livewire 2 image upload not working on mobile

Hi all, I'm working on a project (going to be used on mobile devices) to upload images taken from a mobile phone the file upload works perfectly in the browse and on some phones but on certain phones the images fail to upload at the minute, I get a livewire validation error message "failed to upload file"

public function updatedFiles()
    {
        $this->validate([
            'files.*' => 'image|max:3072',
        ]);
        $this->counter++;
    }

public function upload()
    {
        $this->validate([
            'agree' => 'required|accepted',
            'files.*' => 'image|required'
          ]);
            $count = 1;
            foreach ($this->files as $file) {
                $file->storePubliclyAs('/contracts/'. $this->reference, $count . '.png', 'public');
                $count++;
            }
            $this->files = [];
  
            $this->dispatchBrowserEvent('notify', 'Files sent!');
        
    }

im not to sure what exactly is going on is there a livewire log or some kind of log I can check on mobile devices? any help would be greatly appreciated

0 likes
2 replies

Please or to participate in this conversation.