• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Add/Delete and View Videos

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am currently building a website using JSP/Servlets, n that I wanted to add a page where user's can add new videos as well as view the videos.
I have no idea as to how to go about with the code as well as how to store the video files and format, etc.
Kindly help me.

Thanks
 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On the input side you need to build a form which accepts files. The servlet which processes the form will download the file (there are plenty of examples of this on the internet), and save it somewhere - more on that later. The servlet should also do validation to make sure this file is not malicious (i.e. only allow certain file extensions to be uploaded, like .avi), if you have any size restrictions (and you should), those should also be enforced, etc.

On the output side, you need a page which displays file references (i.e. names) and links to the actual files for download. Depending on where you store the files, you might need another servlet which actually sends the files over, it has to have access to the files and basically opens a stream and sends it over to the client.

As far as storage is concerned, you have two choices - filesystem or database. Since these are videos, the files will be relatively large, so I would recommend filesystem storage. You can store the file references in the database for quick lookup, but you can also just always search the directories, especially if you organize them well. The files themselves have to be in a location that is accessible to your app server.
reply
    Bookmark Topic Watch Topic
  • New Topic