Hi,
is there any way to populate returned images from server into uppy dashboard?
Thank you in advance.
Hi,
You can update the preview for a specific file the Uppy Dashboard shows, by doing something like uppy.setFileState(fileID, { preview: 'http://myPreviewUrlFromServer' }).
Or are you asking about pre-populating it with files that are already on your server, like a media library?
@arturi thank you for your response.
Yes, I was thinking of pre-populating with files that are already on server.
@arturi can I expect another answer from you? :)
@be-codified I don't know if you've sorted this now but I achieved this with the uppy.addFile() method. I built a JSON array of uppy configuration objects representing all the files on the server. I grabbed the file contents of every image and converted them to base64 then on the client side looped over the JSON array and converted the base64 image representation back to a file blob before passing the file configuration object to the addFile() method.
@be-codified it’s on our todo, but we are focusing on other things to release Uppy 1.0, then we’ll look into the “gallery” idea once more. We’d be happy to link to your custom plugin that achieves this too 😉👍
Closing in favor of #450.
Most helpful comment
@be-codified I don't know if you've sorted this now but I achieved this with the
uppy.addFile()method. I built a JSON array of uppy configuration objects representing all the files on the server. I grabbed the file contents of every image and converted them to base64 then on the client side looped over the JSON array and converted the base64 image representation back to a file blob before passing the file configuration object to theaddFile()method.