bruckerrlb Posted November 20, 2007 Share Posted November 20, 2007 Hello, I am trying to tweak an old script to upload videos, and I am wondering if anyone knows how I can check to make sure a flv file is something being uploaded. For example, the swf I have ($_FILES["file"]["type"] == "application/x-shockwave-flash") Yet not sure what I could use for flv. Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 20, 2007 Share Posted November 20, 2007 do this echo '<pre>'; print_r($_FILES); echo '</pre>'; now when you upload anything all the information about that file will be displayed... Quote Link to comment Share on other sites More sharing options...
bruckerrlb Posted November 20, 2007 Author Share Posted November 20, 2007 Hi Teng, Thanks for the tip. I did that, but it gives me a name to use that is a "blanket" name meaning it's the name used for all files. Plus when I tried it it didn't work Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 20, 2007 Share Posted November 20, 2007 you should upload something.. eg.. trough form Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 20, 2007 Share Posted November 20, 2007 try to upload any file <?php echo '<pre>'; print_r($_FILES); echo '</pre>'; ?> <html> <body> <form action="<? $_SERVER['PHP_SELF']?>" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html> Quote Link to comment Share on other sites More sharing options...
bruckerrlb Posted November 20, 2007 Author Share Posted November 20, 2007 This is the code that it gave me ( [file] => Array ( [name] => WIRELESS WORLD FULL_112K.flv [type] => application/octet-stream [tmp_name] => /tmp/phpNugkNo [error] => 0 [size] => 207337 ) ) When I first tried to do this, I spelt octet wrong, that's why it didnt' work!! Anyway, I was reading that using application/octet-stream isn't good to do because people can upload viruses to the server. Yet, since this is for just one person to use, and they have to be logged in to even see this page, I doubt they are going to want to comprimise their own server. Thanks for the help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.