Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

video

Status
Not open for further replies.

farazmit

Programmer
Jan 3, 2005
14
US
Hi
Does anyone know how I can check for different video formats. I am creating a website in which people can upload funny videos. I am not sure how to check whether a file is .mov. The easiest way is to check for the file extention. I believe this is not enough cause now a user can just changed a text file's extension and pretends that it's a video. Can somebody tell me which property I should look for within .mov file to make sure it's a video
Thanks
Faraz
 
You would probably need to ask this in a different forum, or even a different board. I suggest searching for a multimedia forum / board and asking there. You really would not want to use Javascript to do this (client-side is virtually impossible, and server-side wouldn't be much better).

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
...server-side wouldn't be much better
Well... since you can access data at the byte level server-side, I would imagine that you could do it very satisfactorily server-side.

Step one may be checking the file extensions. That can be done client-side with ease. You would also be encouraged to do the same thing server-side (to catch people who managed to bypass the javascript checks).

Once you have verified that the file being uploaded has an acceptable file extension... then you can begin looking at the actual contents of each file type. You will have to find out (google? usenet? other forums?) what you can test for (at the byte level) in the file to prove it is a valid video.

Personally I would not bother looking at the actual file contents (although you could look at the first few bytes to determine that the file wasn't a ZIP file or an EXE file).

Just some thoughts [smile]

Cheers,
Jeff
 
I specifically meant with server-side JavaScript, given that this is the JS forum.

Server-side would definately be the way to go - and it might turn out that someone has written a server-side JS library to do this. Try Google.

Hope this clarifies things,
Dan




[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top