Jump to content


This topic is now archived and is closed to further replies.


help getting filetype

Recommended Posts

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);

Share this post

Link to post
Share on other sites
I have added both mime and filetype and neither one works

I have enabled mine in php.ini and added <?php to magic.mime file

using the below function and still getting nothing but [file]

anyother Ideas Please

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>";

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.