You are here: file_exists and thousand of files « PHP Programming Language « IT news, forums, messages
file_exists and thousand of files

Posted by julian_m on 06/13/06 00:13

I've a site working as follows

Table "articles"
[id]
[name]
[...more fields]

When somebody want to see the article's details, I generate (thorugh
php) a page where all the detalis are listed, as well as the article's
views (images)

If the articles's id is $id, then, I search for its images this way:

for ($i=1;$i<11;$i++){
$filename= $path.$id.'_'.$i.'.jpg';

if (file_exists($filename)) {
Show the image here
}

}///for


This let me upload from 1 to 10 views, and show them as long as they
are in the sever

Pretty easy as you can see, but, the problem is that there could be (in
fact, there will be) more that 10000 images in the same directory.
I'm wondering whether there will be some kind of speed-problem with
file_exists function using it to search among such a number of files...

Had anyone experiences/problems with this ?

regards - jm

 

Navigation:

[Reply to this 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

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