<?php
require ('files_upload.inc');
#seting class;
#images_upload(upload directory, max filesize, files info - filename);
$upload = new images_upload('c:/pphotos/', 100000, 'info.dat');
#seting files url;
$photo_url = "http://localhost/pphotos/";
//chek if file need to be deleted
//$_GET[del] = one index of files array
if ($_GET[del]) {
$upload->del($_GET[del]);
}
#geting files info from file info.dat
$photo_list = $upload->read_data();
#creating link's
foreach ($photo_list as $key=>$val){
$input .= "<a href='".$photo_url.$key."' target=_blank>".$val['desc']."</a> | <a href='files_list.php?del=$key'>Delete file</a><br>";
}
?>
<HTML>
<a href="file_upload.php">file Upload</a>
<br>
<br>
<? echo $input?>
</HTML>
|