SpatieMediaLibraryFileUpload gets images from a third-party AP.
Is it possible to have a button that retrieves images from a third-party API, and once the photos are fetched, automatically attach them to the SpatieMediaLibraryFileUpload form field?
11 Replies
bump cause i've got similar question and curently working on it 😄
What is your workaround so far @Daniel Heinze ?
not yet, but i let you know if i handle it somehow
Sounds like it should be possible via an Action, that runs the code and then updates the state of the form 🤔
Yeah, that’s what I’m currently doing — fetching data from a third-party API, which I already have. But my issue is how to display it in SpatieMediaLibraryFileUpload.

Did you already save the data from the third party API to your filesystem?
It's dynamic fetching, Sir, but example I have fetched image: https://images.pexels.com/photos/2325447/pexels-photo-2325447.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1
I am not sure how this actually work, but I heard of Livewire\TemporaryUploadedFile; Not sure if that's something I can use.
I think this plugin can give you some inspiration. Sounds like you are trying to do something similar: https://github.com/mansoorkhan96/filament-unsplash-picker
GitHub
GitHub - mansoorkhan96/filament-unsplash-picker: Unsplash gallery f...
Unsplash gallery for Filament. Search and pick any image from Unsplash.com - mansoorkhan96/filament-unsplash-picker
Mate, in case you're still trying to figure it out, maybe this one can help you https://silvanhagen.com/writing/background-file-upload-in-filament-forms/
thanks, i will look at it. all i need is to put already uploaded file into the fileupload and display there