This topic is locked

verification of file exisit in upload folder

8/7/2007 12:04:57 PM
PHPRunner General questions
R
rgman author

In need a quick to see if a file exists in the upload folder. I have 5000 pdf files that exist in the upload folder and the amount of files are going to double in the next 2 months. The file names are being bulk inserted into the column set to file / image. My web site is working perfectly. But I would like to have a check box that gets populated on the screen so I can quickly see if the file name on file/image column has a corresponding file in the upload folder. It would also be nice to be able to run a report that tells me which files are not linked.

I am not sure if I formulated the question properly but this basicly what I need.
Thakns for any help with this.
Rgman <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=5927&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />

J
Jane 8/8/2007

Hi,
you can do it editing generated ..._list.php file manually.

Find this code:

$value = GetData($data,"File", "Document Download");

$span="<span ";

$span.="id=\"edit".$recno."_File\" ";

$span.=">";

$value = $span.$value."</span>";

$row[$col."File_value"]=$value;



and replace it with this one:

$value = GetData($data,"File", "Document Download");

$span="<span ";

$span.="id=\"edit".$recno."_File\" ";

$span.=">";

$value = $span.$value."</span>";

if (file_exists("files/".$data["File"]))

$row[$col."File_value"]=$value;

}



where File is your actual field name.