Jump to content

help getting filetype


jvrothjr

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);
}
[/code]
Link to comment
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

[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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.