Reply to Re: [PHP] readdir and mime types

Your name:

Reply:


Posted by Graham Cossey on 11/22/05 16:38

On 11/22/05, Jay Blanchard <jay.blanchard@thermon.com> wrote:
> [snip]
> I'm attempting to read a list of files in a directory using readdir()
> but am having problems with mpeg files not seemingly being read.
>
> Cope snippet:
>
> $count = 0;
> while (false !== ($file = readdir($open_dir)))
> {
> if ($file != '.' && $file != '..')
> {
> if (file_exists("$VID_DIR/$file"))
> {
> $count++;
>
> $count counts any 'avi' files but not 'mpg' files.
> [/snip]
>
> Without seeing the rest of the code I am going to assume that $open_dir is
> the handle for the directory the files are in. Given that, why would you
> specify a directory in your file_exists function? I am unsure why
> file_exists would be necessary at this point. Eliminate that condition and
> see what the results are
>
Yes $open_dir is the handle from opendir().

The file_exists is simply checking for an associated file elsewhere as
I'm looking for video files and thumbnails.

As I said, this works fine for avi suffixed files but not mpg or mpeg
suffixed files.

--
Graham

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация