Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old January 31st, 2002, 12:07 AM
Winnie Winnie is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Posts: 38 Winnie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
How can we stop someone from linking directly to your images?

Hello.

Can we stop someone from linking directly to your images?

Like php, some perl code or something, so that it can only be done on the root server [linking to that image] and not from another server [or site]?

Thanks.

Reply With Quote
  #2  
Old January 31st, 2002, 03:43 AM
NoXcuz's Avatar
NoXcuz NoXcuz is offline
Wiking
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Sep 2000
Location: Sweden
Posts: 3,608 NoXcuz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 49 m 27 sec
Reputation Power: 11
If you're using Apache, you could find things like this to be useful -> http://forums.devshed.com/showthrea...4331&forumid=15

//NoXcuz
__________________
UN*X is sexy!
who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep

Reply With Quote
  #3  
Old February 4th, 2002, 03:41 PM
estrabd's Avatar
estrabd estrabd is offline
o0o.o0o
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: m00n
Posts: 184 estrabd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 4 m 48 sec
Reputation Power: 8
Send a message via ICQ to estrabd Send a message via AIM to estrabd Send a message via Yahoo to estrabd
Every so often, you can rename your images with a randomly generated name, and keep a text file listing the 'real' name with the generated name.

##
File format:

[real name] [generated name]
img1.gif 34reffdsf4k.gif
img2.gif dfdfdr4f4fa.gif
img3.gif 3fsdfe4wf4k.gif
img4.gif 343ffddk.gif
##

for example,
1) every 30 mins or so, run the function that renames your files and writes the file that maps the real name to the random name.
2) to get the actual file name, create a function like:

PHP Code:
<? echo getImage("img1.gif","mapFile.txt"); ?>


that would take "realname.gif", find it in mapFile.txt, and return the associated dynamically created name, and thus give you the file for that moment in time.

Now, if you are talking about how to make sure your images are not copied via the browser, that is a browser issue.

There are also ways you can dynamically water mark your images.

Brett

Reply With Quote
  #4  
Old February 4th, 2002, 03:54 PM
The Soulgirl The Soulgirl is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Posts: 7 The Soulgirl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You could always choose the easy option and code as a flash movie!

Reply With Quote
  #5  
Old February 5th, 2002, 01:50 AM
Datamike's Avatar
Datamike Datamike is offline
Web Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2001
Location: Finland
Posts: 719 Datamike User rank is Corporal (100 - 500 Reputation Level)Datamike User rank is Corporal (100 - 500 Reputation Level)Datamike User rank is Corporal (100 - 500 Reputation Level)Datamike User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 27 m 33 sec
Reputation Power: 9
Quote:
Originally posted by The Soulgirl
You could always choose the easy option and code as a flash movie!

Bad idea...

Flash is good but it doesn't make do you good building entire sites with it. It's not very user friendly...
__________________
-- Tomi Kaistila
-- Developer's Journal

The more you learn, the more you know.
The more you know, the more you forget.
The more you forget, the less you know.

Reply With Quote
  #6  
Old February 5th, 2002, 03:56 AM
binky's Avatar
binky binky is offline
Gerbil
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2001
Location: In a Rotastak
Posts: 1,763 binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 22 h 12 m 52 sec
Reputation Power: 18
It's a tad drastic but you could always keep a copy of the original file somewhere and use php to copy that file to the servers tmp directory with a temporary filename. Look at the manual for string tempnam (string dir, string prefix) under filesystem functions. Then all you do is put a PHP variable in the img src. By the time anyone links to the files they should have been deleted.

Reply With Quote
  #7  
Old February 5th, 2002, 03:58 AM
Datamike's Avatar
Datamike Datamike is offline
Web Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2001
Location: Finland
Posts: 719 Datamike User rank is Corporal (100 - 500 Reputation Level)Datamike User rank is Corporal (100 - 500 Reputation Level)Datamike User rank is Corporal (100 - 500 Reputation Level)Datamike User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 27 m 33 sec
Reputation Power: 9
I actually find the method estrabd explained to be the best. It's simple and flexible.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > How can we stop someone from linking directly to your images?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway