Hotlinking Images? No. Wget Instead.

There's an open feature request for the Embedded Media Field to allow editors to link to a live image on any arbitrary site. Although this is technically possible, and easy to implement in the module's framework, this practice is also known as hot-linking, and I'm not particularly interested in enabling that sort of functionality.

However, the discussion on that queue did lead to another interesting possibility. Using file_get_contents (or maybe more efficient method?), I can 'wget' an image and store it to the server. Then the image can just be served locally. I was already examining that possibility for storing (YouTube, Blip.TV, etc.) video thumbnails as well, so I should be able to sign off on two tasks with this mini-project.

It opens up the possibility of copyright violation, but I leave it to the lawyers to fight over that one. And though there are certainly some cases where a hotlink implementation might be okay, I'm personally not interested in encouraging that.

Aaron

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <strike>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options