NorthWestSimulations Posted January 30, 2009 Share Posted January 30, 2009 I know it has to be in the $_FILES["file"]['']; array somewhere. I just cant find it. Lets say I upload a file named "test.wav" How do I get just the part of "wav" or if someone uploads a file like "Walalal.Test.haha.BooYeah.txt" it will take "txt" as the extension type. Hmm... Im curious, Any ideas how I get this info? ??? Quote Link to comment Share on other sites More sharing options...
phpSensei Posted January 30, 2009 Share Posted January 30, 2009 <?php $path_parts = pathinfo('/www/htdocs/index.html'); echo $path_parts['dirname'], "\n"; echo $path_parts['basename'], "\n"; echo $path_parts['extension'], "\n"; echo $path_parts['filename'], "\n"; // since PHP 5.2.0 ?> from php.net/pathinfo or try http://php.about.com/od/finishedphp1/qt/file_ext_PHP.htm Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted January 30, 2009 Share Posted January 30, 2009 The value you're referring to is $_FILES["file"]['type']; but it's not guaranteed to be authentic as php does not check to ensure that it is accurate. Quote Link to comment Share on other sites More sharing options...
NorthWestSimulations Posted January 30, 2009 Author Share Posted January 30, 2009 Thank you guys. I figured it out 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.