Hello!!
My problem today is this one
File Download
file1.pdf yes
file2.doc yes
The idea is this one , One user wants to upload a file a pdf or .doc file and that file can be displayed in another php page. where a second user can download a specific file.
I create two php files and I have a result , but its not a table and is missing the “yes” download link
A simple view of the upload
<h1>Files</h1>
<form action="viewfiles.php" method="post" enctype="multipart/form-data">
<p><strong>Upload files:</strong><br />
<input type="file" name="file" size="700" id="file"></p>
<p>
<input type="submit" value="Upload" />
</p>
the second file with the view of the table with pdf or doc:
viewfiles.php
[php]
if ($_FILES)
{
$name = $_FILES[‘file’][‘name’];
switch($_FILES[‘file’][‘type’])
{
case ‘application/pdf’: $ext = ‘pdf’; break;
case ‘application/msword’: $ext = ‘doc’; break;
default: $ext = ‘’; break;
}
if ($ext)
{
echo ‘
Name | Download |
---|---|
’."$name yes" . ‘ | ’;