File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Restricting access via url to (video files)folder in application folder present in tomcat webapps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Restricting access via url to (video files)folder in application folder present in tomcat webapps" Watch "Restricting access via url to (video files)folder in application folder present in tomcat webapps" New topic
Author

Restricting access via url to (video files)folder in application folder present in tomcat webapps

kranthi chamarthi
Ranch Hand

Joined: May 08, 2007
Posts: 95
Hi,
I am developing an online video sharing site. I am using tomcat 5.5.17 for my project. I am having my application folder in webapps of tomcat. In my application folder there is another folder where i have my .flv video files. Now, user can watch the video by accessing videodisplay.jsp where i have a open source flv player embedded. I will supply the url of the video file to the player in that page. Problem is if the user right clicks and views the source of videodisplay.jsp, he can get the url of my video file. He can simply copy paste the url and download the file. Is there a way to prevent this from happening???. My tomcat is present on a windows 2003 server machine.
Thanks
Kranthi
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12675
    
    5
One way would be to store your video files in the Amazon cloud and have your app serve a page with a URL having a restricted lifespan. Here is my example page.

This would have the advantage of unloading a huge bandwidth hog from your server. But in any case, once you have handed out a video stream you have no control over what the user does with it.

Bill

Java Resources at www.wbrogden.com
kranthi chamarthi
Ranch Hand

Joined: May 08, 2007
Posts: 95
Thanks for the suggestion, but can't we do this without using amazon s3.
I was googling about this and found that saving the video files as blob in database may solve the problem. How far this is a feasible solution?
Thanks
Kranthi
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12675
    
    5
I dont see what you gain from a blob.

Basically you want your video file to NOT be accessible with a normal URL. This can just be a directory that the server cant address directly. Therefore you will have to write a servlet which will get the request, figure out where the file is, and start streaming it to the response.

A google search for "java streaming video" finds lots of interesting options.

Bill

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Restricting access via url to (video files)folder in application folder present in tomcat webapps
 
Similar Threads
blocking access to images
blocking access to images
Tomcat deployment with WAR
location/directory used by JRE, for saving the temporary Internet files
Blocking access to images