XF 2.0 Paste images from web browser as bbcode image

DL6

Well-known member
In XF1 users could paste the images copied from the browser as a bbcode image in the editor, but in XF2 this does not work anymore, has this function been removed in XF2?
 
Users already know that option, but they prefer to copy the image and paste it directly into the editor because it is much faster.
 
Sorry, i mean in the text area in the editor, not using the button in the editor.
TwPSabo.gif
 
hmm. had no idea xenforo 1 would create a hotlinked bbcode when you pasted an image in the editor. xenforo 2 uploads the image and creates an attachment out of pasted image.
 
hmm. had no idea xenforo 1 would create a hotlinked bbcode when you pasted an image in the editor. xenforo 2 uploads the image and creates an attachment out of pasted image.
XenForo 1.x doesn't, it uploads the image and creates an attachment just the same as XenForo 2.0.

@DL6 are you using an add-on that maybe does this? If not, can you do this for any image you find on the web?
 
No, I tested with all add-ons disabled in the default style

Yes, btw in the forum anyone can't upload attachments except the admins, in the test i posted above is tested with the normal users permissions.
Even with those permissions, I still can't copy and paste to create an embed - it simply doesn't do anything.

I can however (whatever the permissions) drag and drop an image from a website into the editor (on both XF1.x and XF2). If you are not doing this, maybe you can describe the exact steps you take (and the browser + OS plus the version number of Xenforo 1.x you are running) used to do this, as it doesn't seem to be a standard feature of XenForo as far as I can tell.
 
After my last post I recalled something way back about copying and pasting images from other sites and in fact 4 years ago I raised a suggestion about this here https://xenforo.com/community/threads/change-copy-paste-picture-functionality-in-1-2.54742/ which was implemented. Long and short of it then was that there was an issue with Chrome which caused this issue - copying and pasting an image caused it to be uploaded and not embedded. It was fixed at the time but it appears that Chrome again uploads images copied and pasted from the web, whereas both Firefox and Safari embed in XenForo 1.5.17.

I've checked in XenForo 2.0 and it seems that both Chrome and Firefox browsers upload copied web images in the new version whereas Safari pastes the URL.

@Mike is this an issue that has changed or needs fixing in XenForo 1.5.x? What about XenForo 2.0?
 
Last edited:
  • Like
Reactions: DL6
We use some different (newer) clipboard APIs now and really it's just down to what data ends up in that clipboard. There can be multiple representations of it, so any approach really is valid in that case (when the image binary data is there). This is ultimately driven by the RTE library in 2.0 and it likely prioritizes the binary data.
 
Yes it is, I've just done it in other threads on here. It also happens when copying and pasting images from another site when using Chrome and Firefox (but not Safari) as per my previous post.
Are you sure it is supported? When I paste an image via my clipboard, I can't save the post at all, the img isn't saved as an attachment.
 
Are you sure it is supported? When I paste an image via my clipboard, I can't save the post at all, the img isn't saved as an attachment.
Yes, I am sure. Here's a screenshot of your post which I've just pasted directly from the clipboard.

1520959830565.webp


You'll need to give more details about the steps you are taking, the browser/computer/OS etc that you are using to determine what the issue is.
 
  • Like
Reactions: sbj
Top Bottom