Jump to content


uploading videos


9 replies to this topic

#1 liveman

    Young Padawan

  • Members
  • Pip
  • 246 posts
  • Location:New Jersey

Posted 18 May 2006 - 06:56 PM

Ok, well I know how to make the script but the problem is when I try to upload a video I dont remeber the part before the extension, IE for an gif image it would be image/gif ... does anyone know what the video form would be?

--
Many Thanks
Liveman

#2 Indigo

    Official Alien

  • Members
  • PipPipPip
  • 617 posts
  • Gender:Male
  • Location:Trondheim, Norway
  • Interests:Computing in general, especially design and programming of all kinds.

Posted 19 May 2006 - 02:33 AM

What kind of video-format do you want to upload? .avi? .wma?
If you´re just going to store the video, not view it, you could probably just zip it and use "application/zip".

#3 liveman

    Young Padawan

  • Members
  • Pip
  • 246 posts
  • Location:New Jersey

Posted 19 May 2006 - 06:00 AM

It will be any kind of video and yes they will be watching it.

#4 origin89

    Young Padawan

  • Members
  • Pip
  • 4 posts

Posted 27 May 2006 - 12:18 AM

I believe that you want what is know as MIME Types. Here are the MIME Types for video files:

Quote

video/mpeg - mpg, mpeg, mpe
video/vnd.vivo - ____
video/quicktime - qt, mov
video/x-msvideo - avi
video/x-sgi-movie - movie
From: http://www.ltsw.se/

I don't know if there are more or not.

Edited by origin89, 27 May 2006 - 12:19 AM.


#5 Ruben K

    Cliff

  • Twodded Staff
  • PipPip
  • 438 posts

Posted 27 May 2006 - 02:21 AM

<?
$filename = 'test.avi';
$extension = explode( '.', $filename );
$extension = $extension[1];
?>

Edited by Cliff, 27 May 2006 - 02:22 AM.


#6 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 27 May 2006 - 04:31 AM

Cliff, ever though what would happen if someone uploaded "image.jpg.php"?

Never use that method.

#7 Ruben K

    Cliff

  • Twodded Staff
  • PipPip
  • 438 posts

Posted 27 May 2006 - 12:50 PM

View Post.Matt, on May 27 2006, 09:31 AM, said:

Cliff, ever though what would happen if someone uploaded "image.jpg.php"?

Never use that method.
<?
$filename = 'test.jpg.avi';
$extension = explode( '.', $filename );
for( $i=1; $i < count( $extension ) - 1; $i++ )
{
  $extension.= $extension[ $i ]; 
} 
?>

Edited by Cliff, 27 May 2006 - 12:50 PM.


#8 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 27 May 2006 - 12:56 PM

Now thats more like it :D

#9 Ruben K

    Cliff

  • Twodded Staff
  • PipPip
  • 438 posts

Posted 27 May 2006 - 06:46 PM

Also you could just put the last extension because that's basically the actual extension.

$filename = 'test.jpg.avi';
$extension = explode( '.', $filename );
$extension = $extension[ count( $extension ) ];


#10 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 28 May 2006 - 08:36 AM

this is how i do it, works better than messing with mime types and stuff imo.

$filename = 'test.jpg.avi.exe.zip.exe.p2l';
$extension = array_reverse($extension);
$extension = $extension[0];

the extension will always be the last one, if you reverse the array it will always be the first one.


1111th post btw ;)

Edited by Avalanche, 28 May 2006 - 08:37 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users