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? ??? Link to comment https://forums.phpfreaks.com/topic/143090-solved-where-is-that-extension-type/ 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 Link to comment https://forums.phpfreaks.com/topic/143090-solved-where-is-that-extension-type/#findComment-750437 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. Link to comment https://forums.phpfreaks.com/topic/143090-solved-where-is-that-extension-type/#findComment-750443 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 Link to comment https://forums.phpfreaks.com/topic/143090-solved-where-is-that-extension-type/#findComment-750636 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.