Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How Can I hide the location of a file?
Old 08-18-2007, 04:52 PM How Can I hide the location of a file?
goheadtry's Avatar
Webmaster Talker

Posts: 730
Name: John
Location: United States of America, California
Trades: 0
This is my code I am wondering how I can protect the location of the flv?
HTML Code:
<object type="application/x-shockwave-flash" data="FLVPlayer_Progressive.swf?MM_ComponentVersion=1&skinName=Halo_Skin_3&streamName=http://www.technologyforever.com/secretfile.flv&autoPlay=true&autoRewind=true&scale=noscale&quality=high" 
   width="400" height="300">
   <param name="movie" value="FLVPlayer_Progressive.swf?MM_ComponentVersion=1&skinName=Halo_Skin_3&streamName=http://www.technologyforever.com/secretfile.flv&autoPlay=true&autoRewind=true&scale=noscale&quality=high" />
   <img src="noflash.gif" width="320" height="100" alt="" />
</object>
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
 
Register now for full access!
Old 08-19-2007, 04:28 PM Re: How Can I hide the location of a file?
JamieLewis's Avatar
Pretty Much a Big Deal...

Latest Blog Post:
Gooie
Posts: 385
Name: Jamie Lewis
Location: UK
Trades: 0
You could put the file in a database (the entire file in binary format), then use php to generate the file dynamically.

Jamie
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
JamieLewis is offline
Reply With Quote
View Public Profile Visit JamieLewis's homepage!
 
Old 08-19-2007, 04:39 PM Re: How Can I hide the location of a file?
goheadtry's Avatar
Webmaster Talker

Posts: 730
Name: John
Location: United States of America, California
Trades: 0
Wait if I do that wouldn't that just generate the file location?
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
Old 08-19-2007, 04:43 PM Re: How Can I hide the location of a file?
JamieLewis's Avatar
Pretty Much a Big Deal...

Latest Blog Post:
Gooie
Posts: 385
Name: Jamie Lewis
Location: UK
Trades: 0
Um....no

The file would be in the database, you could then use php to pull the file (because php is a nice language you can perform authority checks and other such things before generating the video)

Jamie
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
JamieLewis is offline
Reply With Quote
View Public Profile Visit JamieLewis's homepage!
 
Old 08-19-2007, 06:11 PM Re: How Can I hide the location of a file?
goheadtry's Avatar
Webmaster Talker

Posts: 730
Name: John
Location: United States of America, California
Trades: 0
Okay could you please give me an example of how this is done?
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
Old 08-19-2007, 10:58 PM Re: How Can I hide the location of a file?
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
Just a moment, let me get some code together for this.
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Old 08-19-2007, 11:56 PM Re: How Can I hide the location of a file?
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
I'm gonna need a little more time on this

Gonna have to wait till morning...I'm off to bed.
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Old 08-20-2007, 01:17 AM Re: How Can I hide the location of a file?
goheadtry's Avatar
Webmaster Talker

Posts: 730
Name: John
Location: United States of America, California
Trades: 0
I also want to make it possible to embed these videos in other sites but I don't know how to make the embed simpiler so that it is as easy as youtube has theirs
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
Old 08-20-2007, 09:52 AM Re: How Can I hide the location of a file?
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
gah, I this code's confusing me. Someone else please help him.

I can't get it to work like youtube >.<
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Old 08-20-2007, 11:11 AM Re: How Can I hide the location of a file?
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
couldnt you just have:

PHP Code:
$id=$_GET['id'];
switch(
$id)
{
case 
'video_id_5622':
header('Content-Type: video/x-flv');
readfile('/home/username/securefolder/video.flv');
break;
 
case 
'video_id_546545':
header('Content-Type: video/x-flv');
readfile('/home/username/securefolder/video2.flv');
break;
 

or soemthing like that but maybe done via database would be better.

and if u store them in a folder before the public_html they can only be accessed via PHP

this should keep the source from public view and (i think)

you could just use the url for the video as video.php?id=video_id_659626g

and it should then read the .flv into the php and work as if you linking directly to the .flv

i think in theory this should work.

and if its differant video types then just do a quick google for "content-type video format
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 08-20-2007, 12:10 PM Re: How Can I hide the location of a file?
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
That's exatly what I was looking for...and you could just have it get the cases from a MySQL database.

If you need the code for that, I can get that for you.
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Old 08-20-2007, 01:46 PM Re: How Can I hide the location of a file?
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
yurp!

i think this should be what you need

PHP Code:
# DB CONNECT
# DB SELECT
 
$result mysql_query("SELECT * FROM videos");
 
$id$_GET['id'];
switch(
$id
{
 
while(
$row=mysql_fetch_array($result))
{
 
case 
'{$row['id']}':
 
header('Content-Type: video/x-flv');
readfile($row['video_path']);
break;
}
 
}
?> 
i think that should do it

TALKUPATION IS APPRIECIATED!!!
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 08-20-2007, 07:12 PM Re: How Can I hide the location of a file?
extra.account's Avatar
Average Talker

Posts: 25
Trades: 0
Isit really necessary to protect your files so much? I don't think you're going to need security as hard as this to protect a few files / bandwidth
extra.account is offline
Reply With Quote
View Public Profile
 
Old 08-20-2007, 08:12 PM Re: How Can I hide the location of a file?
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
He said he wanted people to be able to embed them...he's not trying to save bandwidth.

I really have no idea what he's trying to achieve here. People can still access the files on a seperate server, and they can still save the swfs...
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Old 08-20-2007, 08:13 PM Re: How Can I hide the location of a file?
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
lets just play along.. and hopefully i can get some TP
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 08-20-2007, 08:16 PM Re: How Can I hide the location of a file?
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
I sure could use some
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Old 08-20-2007, 08:16 PM Re: How Can I hide the location of a file?
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
I wouldn't store the files in a database myself; they're able to store long binary data, but not terribly efficient at it, and pulling the movies out to serve is going to flood the db engine's cache.

You might want to consider url rewriting instead, sending the person to a page that does an authorization check and then serves up the data from a file. So long as the redirection is server-side, the client won't know the true location of the file, just what they requrested and what the status code was.

Saving the swf or mov files is another point you need to consider. You can stream them, but I don't know how effective this is ... I've never had to do it.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 08-20-2007, 08:21 PM Re: How Can I hide the location of a file?
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
Quote:
Originally Posted by ForrestCroce View Post
I wouldn't store the files in a database myself; they're able to store long binary data, but not terribly efficient at it, and pulling the movies out to serve is going to flood the db engine's cache.

You might want to consider url rewriting instead, sending the person to a page that does an authorization check and then serves up the data from a file. So long as the redirection is server-side, the client won't know the true location of the file, just what they requrested and what the status code was.

Saving the swf or mov files is another point you need to consider. You can stream them, but I don't know how effective this is ... I've never had to do it.
But what's the point of the client not knowing what the location of the file is? The only logical thing is that he doesn't want people to steal the games to put them on their own server. As far as I know, there really isn't a way to do that.
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Old 08-20-2007, 08:22 PM Re: How Can I hide the location of a file?
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
I think you just have to look at it youtube has this.

and while probally 95% of their users dont know you can download the videos from youtube/google to their PC the other 5% do..

btw.. im one of the 5% i love being a minority (which is a really good song by Green day )

and if you would like to know i happen to have a script which i came accross to download videos off you tube

http://dansgalaxy.co.uk/youtube_download

it just get sthe source of the flv and shows a link.


BUT i dont think if you do what i said where they are actually stored below he public_html/WWW fodler is they should be able to downlaod them like that.

so anyway give the script a try
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 08-20-2007, 08:42 PM Re: How Can I hide the location of a file?
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
Yeah YouTube has this same kind of script :P

But if you know how to do it, it's not that hard to download the FLV file
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Reply     « Reply to How Can I hide the location of a file?

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.58697 seconds with 12 queries