Login   Register  
PHP Classes
elePHPant
Icontem

File: files_list.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Adomas Rimeika  >  File Uploading with Description  >  files_list.php  >  Download  
File: files_list.php
Role: Example script
Content type: text/plain
Description: sample files listing
Class: File Uploading with Description
Manage file uploading forms with description texts
Author: By
Last change: added fuctions to delete file and his description
Date: 2004-03-31 09:51
Size: 759 bytes
 

Contents

Class file image Download
<?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>