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
SnaggyDainc
SnaggyDainc2d ago
bump cause i've got similar question and curently working on it 😄
Nicole
NicoleOP2d ago
What is your workaround so far @Daniel Heinze ?
SnaggyDainc
SnaggyDainc2d ago
not yet, but i let you know if i handle it somehow
Dennis Koch
Dennis Koch2d ago
Sounds like it should be possible via an Action, that runs the code and then updates the state of the form 🤔
Nicole
NicoleOPthis hour
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.
No description
Dennis Koch
Dennis Kochthis hour
Did you already save the data from the third party API to your filesystem?
Nicole
NicoleOPthis hour
I am not sure how this actually work, but I heard of Livewire\TemporaryUploadedFile; Not sure if that's something I can use.
Dennis Koch
Dennis Kochthis hour
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
Nicole
NicoleOP23h ago
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/
SnaggyDainc
SnaggyDainc22h ago
thanks, i will look at it. all i need is to put already uploaded file into the fileupload and display there

Did you find this page helpful?