1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 How to attach image from another site?

Discussion in 'XenForo Questions and Support' started by ToDie4, Oct 31, 2011.

  1. ToDie4

    ToDie4 Well-Known Member

    I can't seem to find how we attach an image from an url instead of uploading directly from our computer.

    Why would I want to do this!
    In example one might use an online image host like photobucket to store larger images (byte-size) and then link to them within posts to save on server bandwidth.

    Why not just use the img bbcode!
    The attachment of images makes use of the thumbnail function in 1.1, the img bbcode does not and I should like to make use of the thumbnail function with linked images.

    If this is not currently possible and I am not missing something here are there any plans on making it possible to attach online files.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You can't "attach" files which are hosted on another server.

    All you can do is embed them, using the standard IMG BB Code tag.
  3. ToDie4

    ToDie4 Well-Known Member

    The functionality is present in vB4, so is this something that is 'not' going to be incorporated into XenForo?
  4. Brogan

    Brogan XenForo Moderator Staff Member

    This is not vB4.

    Download the file from the URL, attach it to the post.
    I clearly never said anything of the sort.
  5. ToDie4

    ToDie4 Well-Known Member

    I never said it was vB4, you said it wasn't possible and I have shown it is possible, but obviously it is not possible with XenForo, please read my original post, the files would have been mine to begin with, this is intended as a bandwidth saver with using built in functionality.

    I never said you did say that, I asked a question.
  6. Brogan

    Brogan XenForo Moderator Staff Member

    The file is still being uploaded to the server, just from a URL rather than a computer.

    So my original response still stands; you can't "attach" files which are hosted on another server, you can only embed them.

    I suspect what you meant to ask for is the ability to upload files from a URL?
    If so, that functionality currently doesn't exist in XenForo.
  7. ToDie4

    ToDie4 Well-Known Member

    That would be what I was trying to get at, couldn't figure the right way of putting it. :)
  8. TNCclubman

    TNCclubman Well-Known Member

    yes it does.

    click 'Upload a File > paste the url to the image in the 'file name' section of the popup window > press Open
  9. infis

    infis Well-Known Member

    Only in Windows 7. I don't know, maybe it's work in over versions of Microsoft Windows, but in Linux it's not worked.

    This method is work by OS, not by XenForo.
  10. ToDie4

    ToDie4 Well-Known Member


    @ TNCclubman, it does as well, but as Brogan pointed out, I was barking up the wrong tree, I worry that what I am trying to do simply cannot be done.

    I need to be able to display my artwork on my own website in threads but have the image actually hosted on PhotoBucket (and not my websites server) so my website uses no bandwidth when people view my artwork.
  11. Brogan

    Brogan XenForo Moderator Staff Member

    If you are doing what is known as hotlinking (embedding images from another server), then you will use the bandwidth of that server.

    The only way to avoid that is to upload the images to your own server.

    Uploading to PhotoBucket should achieve what you want, unless I have misunderstood.
  12. ToDie4

    ToDie4 Well-Known Member

    Hotlinking from your own photobucket account is okay, they even provide you with links to do it.

    The problem with this is that the img bbcode doesn't use the thumbnail function that we have in 1.1 with attachments, I've tried using an image resizer bbcode for the img but can't get it to work, I'll just have to regard this as a dead end road.
  13. Brogan

    Brogan XenForo Moderator Staff Member

    That function only works with uploaded images, as the code can't confirm that external image URLs are actually images.

    You can always limit the size of embedded images by adding this to EXTRA.css:
    .bbCodeImage {
    max-width: 100px;
    max-height: 100px;
    Change the px values to suit or use a % if you prefer.

    Or, you can install the BB Code Manager add-on and create some custom BB Code allowing you to resize embedded images.

    There's always a way ;)
  14. TNCclubman

    TNCclubman Well-Known Member

    windows XP confirmed working as well.
  15. infis

    infis Well-Known Member

    Essence of the matter does not change. When the operating system downloads for you a file in a temporal folder, and then substitutes a path to the downloaded file to input field in window "Open file" and sends as a result of it on the server, it not same that the server takes URL and downloads a file itself from it URL.
    Loading of files of a file from a remote server server means is in certain cases necessary. And speech in this topic goes about it. The decision in a type "download it from other server and download it on this" in no way does not solve a problem.
    There is some analogy to media links. It is possible most to open the link and to look, and it is possible to entrust the server to analyze the link and to interpose the necessary code for review in a post. Certainly, it only analogy, but I think, the sense is clear.
  16. TNCclubman

    TNCclubman Well-Known Member

    can you post the link to the image you want to upload directly from url so I can try my method?

    Basically what you're saying now is that it does work, but you want it to work your way correct?
  17. infis

    infis Well-Known Member

    I want, that the server itself loaded with specified URL the image without my participation.
    For this purpose it is required to give to the user a choice: to load the image from the local machine or to load the image from the remote server. Accordingly, are necessary or two buttons: "Upload a File from Local Machine" and "Uplod a File from Remote Server". Or the button "Upload a File" will deduce a window in a browser through javascript with the offer of local loading or removed. Thus remote loading is input URL of a file not through a dialogue window of the browser, and in input filed.

    I do not know, whether correctly I speak. Excuse, but I English language am not my native.

Share This Page