jvrothjr Posted September 12, 2006 Share Posted September 12, 2006 My question here is I need to know the file type of file list from a directory and feed to the is function all its telling me is file or dir and I need to know image or text type. Can some one help with this.basiclly getting revision of files listed under root directory of server just need to know the type of file it is..................[code=php:0]Function Setrecloop($form_data){// Set variable of file data $Filesize = filesize($form_data); $Filetype = filetype($form_data); }[/code] Quote Link to comment Share on other sites More sharing options...
Barand Posted September 12, 2006 Share Posted September 12, 2006 you might want to look athttp://www.php.net/mime_content_type Quote Link to comment Share on other sites More sharing options...
jvrothjr Posted September 13, 2006 Author Share Posted September 13, 2006 I have added both mime and filetype and neither one worksI have enabled mine in php.ini and added <?php to magic.mime fileusing the below function and still getting nothing but [file] anyother Ideas Please[code=php:0]Function Setrecloop($dirpath,$form_data){ $filepath = $dirpath."/".$form_data; $data = addslashes(fread(fopen($filepath, "r"), filesize($filepath))); $filepath_size = filesize($filepath); echo mime_content_type($filepath)." Testing filepath</p>"; echo filetype($filepath)." Testing filepath</p>"; echo mime_content_type($form_data)." Testing form_data</p>"; echo filetype($form_data)." Testing form_data</p>"; echo mime_content_type($data)." Testing data</p>"; echo filetype($data)." Testing data</p>";}[/code] 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.