Native Upload from Image URL Support


We are working through some remaining issues that impact the efficiency of our content production process. One of the key aspects for us is we publish discounted products, so we often reference the image for the product by a URL, rather than downloading an image, then uploading it.

We found it kind of surprising that there isn’t a native capability to upload images from a url, but were able to build a plugin that simply wraps the DatoCMS client javascript library to upload an image from a url. GitHub - dealnews/dato-image-from-url: DatoCMS plugin to support adding images to media area from an existing url

Uploading from Image URL Programmatically

However, many times we write content about a product listing on amazon or other sites with an API. This provides us access to the image url programmatically and we hoped we could easily set the image via an image url, but we ended up having to use the javascript client library to handle this.

The issue I have now is a user drops in an amazon product page URL. We can quickly pull data about that product and populate our form with another plugin we built, however the image upload is painfully slow. I have used the client library and wrote my own function to handle the uploading of images, but either way it seems like it takes about 8-10 seconds for a new image upload to show up in the UI after I have received the data about the product. I have tried small images and large and the difference is minimal.

Feature Request

  • Native Support for Image URL: Every other headless CMS I have worked with supports uploading an image from a url natively and Dato should support that. Directus was the alternative we were considering and it is supported there.
  • Javascript Client Support: You should support uploading from an image url on both the browser and the node library without writing the file to disk (we are using windmill deno runtime and it doesn’t work there)
  • Improve Feedback/Speed: Uploading an image from a url should at least feel faster if it is going to take 10 seconds. If you supported uploading from an image url natively then you could show a preview of the image immediately by having the client render it. The user often will have the image already cached on their machine, but they have to wait a really long time to see feedback that the image is being set.

(Optional) Do you have any sample code you can provide?