spatie/laravel-medialibrary-pro-app

Vue3 MediaLibraryAttachment uploads to temp folder but it returns a validation error and wont write to the database

Closed this issue · 1 comments

Hello,

Using the latest version of laravel, vue3 and media library pro package, In my vue component I added the following component.

<MediaLibraryAttachment name="media" :validation-rules="{ accept: ['image/png', 'image/jpeg', 'image/webp', 'video/mp4'], maxSizeInKB: 25600 }" @is-ready-to-submit-change="isReadyToSubmit = $event" />

I published and did the migrations and the config files but the issue still persists.

The component uploads the image to my local temp folder but returns the following errors and it won write it to db

{ "message": "Could not handle upload. Make sure you are uploading a valid file.", "errors": { "file": [ "Could not handle upload. Make sure you are uploading a valid file." ] } }

image

Not sure what is wrong, I used this package in the past too and I did not encounter this issue.

Thanks

I fixed this issue when I noticed in the error log that the error happened because my computer runs out of memory (I killed docker which consumed a lot of memory 12gb + even though it was not running).

After that the error stopped happening.