Forums

[resolved] [closed] upload via img src should be consistent (15 posts)

  1. Clifford Paulick
    Member
    Posted 1 year ago #

    When uploading an image VIA URL via PressThis (http://codex.wordpress.org/Press_This / http://core.trac.wordpress.org/browser/trunk/wp-admin/press-this.php), the image is copied/uploaded to the uploads folder.

    When in the non-PressThis editor (i.e. regular editor), when you choose an img src via the Media Uploader (seemingly just like in PressThis), the src remains the URL you entered and the image isn't uploaded to the WP Uploads Folder with the img src now sourcing from there.

    Personally, I think they should act the same way, and I prefer the PressThis method because then you don't have to wonder if the URL changes or the image is simply removed from the host URL. Also, this "hotlinking" isn't encouraged by WordPress.

    Granted, sometimes it's desired/required/beneficial to src directly from another domain's URL. So maybe there should be a checkbox to ask whether or not you want it copied into the uploads folder - and possibly another checkbox to ask which src to use.

    Also, when copying into the Uploads folder, I think the image filename should have some sort of timestamp added to it.

    For example,
    img src="http://s.wordpress.org/about/images/logos/wordpress-logo-hoz-rgb.png"
    should be copied to "http://domain.com/wp-content/uploads/2011/11/wordpress-logo-hoz-rgb-20111117.png"
    instead of "http://domain.com/wp-content/uploads/2011/11/wordpress-logo-hoz-rgb.png" (or anything else that makes sense)
    --But copying without a timestamp is better than nothing.

    Anyone agree/disagree?

  2. Alas, this is because you're doing it wrong.

    When in the non-PressThis editor (i.e. regular editor), when you choose an img src via the Media Uploader (seemingly just like in PressThis), the src remains the URL you entered and the image isn't uploaded to the WP Uploads Folder with the img src now sourcing from there.

    This is not UPLOADING an image, this is EMBEDDING (or hotlinking) an image.

    Don't use "From URL", use "From your computer" (Add media files from your computer). THAT will upload them. And no, uploading from a URL is not yet built into WP's media uploader.

  3. Clifford Paulick
    Member
    Posted 1 year ago #

    @Ipstenu, are you Official WP Support? I kind of got that impression from your title...

    Regardless, we agree that upload via URL from regular editor DOES hotlink. However, you seem to be mistaken that the upload via URL from PressThis doesn't copy actual file into Uploads folder. I believe it does. Why? Because it does... Screenshot: http://ScrnSht.com/kbpiat - and I even downloaded to the desktop to make sure they were real .png files.

    Now, unless they're SOMEHOW symlinked or something - I think it's highly unlikely my FTP program would display PNG's if there weren't any actually there.

    I'd love to get your feedback (and anyone else's).

    P.S. Question also posted here: http://wpquestions.com/question/show/id/3395

    Thank you!

  4. I'm a volunteer moderator :)

    However, you seem to be mistaken that the upload via URL from PressThis doesn't copy actual file into Uploads folder.

    No, I know it does, sorry I was unclear :)

    The PressThis editor works differently than the full editor. Don't know WHY, but it does (and actually ... it's an iffy tool in general. I've had it bomb out on me a lot). My guess would be that the code in Press This that can grab all that page information can also scrape the content and upload images, while the full editor, not being cognizant of any other pages, cannot. AND I would speculate that the speed of the full editor would drop (i.e. it'd get real slow) if we tried that.

    The quick answer is this: DO NOT use 'from URL' in the FULL editor if you want to upload the image, it doesn't work like it does in Press This.

  5. Clifford Paulick
    Member
    Posted 1 year ago #

    Thanks for clearing this up. I looked through the code for PressThis, and it doesn't seem to have any WP built-in PHP functions, just straight coding.

    Don't you agree that WP should upload via URL instead of enabling/encouraging hotlinking? I'm not saying they should disable it, just the default should be to upload it and source it yourself - or have a checkbox to pick.

    Anyone out there know how to incorporate into a functions.php or anything like that?

  6. I'm personally really on the fence about this.

    I think the 'Add via URL' should go away entirely most of the time, since people abuse the heck out of it and hot-linking is evil. Except then sometimes I use it to cross link an image from another CMS on my site, and that should be okay.

    And then 'Upload via URL' is similarly fraught with ethical problems for me. For example, much like 'Add via URL' quasi-encourages hot-linking, 'Upload via URL' does the same for image theft, which is really just as bad. The common blogger may not know they can't use images that have a copyright, for example.

    According to this guy, it may already work as you want:

    I figured it out. Apparently you can already do it.

    Just do it as if you were uploading a file from your computer, but when the file browser pops up, rather than clicking a file, just paste the url into the text field.

    It hang for a few seconds, but it works! And it wont just link through the url, it actually uploads it...

  7. Clifford Paulick
    Member
    Posted 1 year ago #

    Thanks!

    Using IE9, I clicked Upload, Browse, pasted http://s.wordpress.org/about/images/logos/wordpress-logo-hoz-rgb.png, WP upload box changed to C:\Users\username\AppData\Local\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5\LGUFLCIQ\wordpress-logo-hoz-rgb[1].png, and the rest is history.

    Great find!

    If you're on WPQuestions.com, answer there (just link to here), and I can award you the whopping $5 prize. :-) Thanks for your assistance!

  8. Done :) Heh, I forget I have an account there all the time.

  9. wlindley
    Member
    Posted 1 year ago #

    Why do you say using the Web as designed is a bad thing? Isn't the whole point of the World Wide Web, to be able to use resources from everywhere? "Hotlinking is evil" boggles the mind: So, you shouldn't point to YouTube for the thumbnail of a YouTube video? You shouldn't embed a news photo when you are commenting on the news story? Indeed, don't you HAVE TO do those things, because COPYING them would be a violation of copyright? Your stance is illogical and against the whole point of the WWW.

  10. ClaytonJames
    Member
    Posted 1 year ago #

    @wlindley

    Why do you say using the Web as designed is a bad thing?

    I think I missed that. I read the thread twice, but I can't seem to find that mentioned anywhere.

    I think what may be implied here, and what you are being overtly contentious about, is that the potential for abuse by linking to objects that reside on sites whose intent is not explicitly for sharing those resources (ie.. your YouTube example) without the owners express permission, is not at all the same as a "fair use" application of resources. You're co-mingling topics that aren't related.

    "Hotlinking is evil" boggles the mind

    Not even the least bit confusing. When done abusively or without consent, it's bandwidth theft at minimum in most cases. It's that simple.

    Your stance is illogical and against the whole point of the WWW.

    That doesn't really sound like a statement that's been based on well informed decision making processes.

  11. wlindley - You misunderstand my point.

    Hotlinking IS evil. Without permission. However YouTube says, outright, "Link to us!" so they give you permission.

    You shouldn't embed a news photo when you are commenting on the news story? Indeed, don't you HAVE TO do those things, because COPYING them would be a violation of copyright? Your stance is illogical and against the whole point of the WWW.

    Actually linking to it is illegal too. It's called 'theft of services' and can get your website shut down. However copying the image, in a low-resolution format, can fall under 'fair use' and be perfectly acceptable.

    But really the point there is "Don't use images you don't have permission to use."

    And that's all off topic for this post, which was a (resolved) technical issue.

  12. wlindley
    Member
    Posted 1 year ago #

    Under what law do you believe that using an img tag as designed and intended is illegal? The ability to include bits and pieces from around the web is precisely what makes the web work. If you embed a thumbnail from Flickr, that thumbnail lives on flickr.com, not your site. That is how the web works! WordPress itself uses jQuery from Google's site, instead of mirroring it on every installation -- do you think that is illegal too? And HTML 5 requires the reference to an external DTD -- is that illegal too? Mind-boggling.

  13. The legality is questionable (maybe, we're not lawyers), but it is a dirtbag thing to do because you would be using bandwidth that YOU have not paid for. When someone hosts an image on their server, they're doing it for their benefit and not yours.

    And HTML 5 requires the reference to an external DTD

    Honestly? Do you really think that a document reference that doesn't actually cause a HTTP request to be generated or use any bandwidth at all is the same as stealing bandwidth?

  14. fonglh
    Member
    Posted 1 year ago #

    WordPress itself uses jQuery from Google's site, instead of mirroring it on every installation

    Google explicitly allows this.

Topic Closed

This topic has been closed to new replies.

About this Topic