Drag and drop from desktop vs other browser window

AI-generated summary

Drag and Drop from Desktop vs Other Browser Window

User chrisallick noticed that dragging and dropping an image from the desktop auto-uploads and appears in the preview, but this doesn’t work when dragging an image from another browser window. They inquired about three possible solutions: enabling this feature in settings, using Imgur for image uploads, or converting drag-and-dropped images from another browser window into an image tag.

zogstrip replied that these features are not currently available, as they require code changes or plugin development. However, chrisallick proposed a potential plugin solution, outlining a workflow involving AJAX upload to S3 (or Imgur API) and displaying the image as an img tag. They expressed interest in developing this plugin, citing its simplicity.

I noticed when I dragged and dropped an image from the desktop it auto-uploaded and showed up in the preview, but when I dragged an image from another browser window it did nothing.

  1. is there a way to turn that on in settings?
  2. is there a way to use imgur for image uploads?
  3. is there a way to have drag and dropped images from another browser window turn into an image tag?

Nope since it’s not a setting. Haven’t tried it but this might require some code change to handle this use case.

Nope. Right now we barely only support S3 as external storage. Feel free to build that as a plugin though.

Why would you need that?

So I would imagine the flow as

  1. user drops image into comment
  2. dropped asset comes from desktop or is url
  3. either way ajax upload to s3 (or using imgur api to save space and money) and return url
  4. display as img tag

I have not developed a plugin for discourse yet, just launched my server, but it would rather simple so maybe i’ll take a crack at it.

Thanks.