Forums

PHP

This topic is locked

how to dynamically link documents?

Posted 08 Oct 2006 19:40:02
1
has voted
08 Oct 2006 19:40:02 ede edd posted:
hi
i've created a basic upload function where user can upload documents to 'upload' folder .

the problem now is
1) how to display the list of documents uploaded in the 'upload' folder and

2) to link the list to the documents so user be able to open that document(or download it).


this is the form.php used to upload :

<form action="upload.php" method="post" ENCTYPE="multipart/form-data">
<p>File:
<input type="file" name="file" size="30">
<input type="submit" value="Upload!">
</p>
<p>  </p>
</form>

this is the upload.php used to upload :

<?php
// ==============
// Configuration
// ==============
$uploaddir = "uploads"; // Where you want the files to upload to - Important: Make sure this folders permissions is 0777!
// ==============
// Upload Part
// ==============
if(is_uploaded_file($_FILES['file']['tmp_name']))
{
move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']);
}
print "Your file has been uploaded successfully! Yay!";
?>


I hope you guys could help


Replies

Replied 08 Oct 2006 19:42:39
08 Oct 2006 19:42:39 ede edd replied:


fyi i am using php , dmx, mysql

thanks

Reply to this topic