[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

PHP web form to upload file and then provide link to download file

We need to use a PHP web form to upload a file (word or excel), then display a link to the file and make it available for others to download.  (We already have a login set up to enable access to this page.)

How is this file displayed for others to see and download?  Can we identify the file using the file name?  Can I list a last modified date for the file?  Can a group of users be notified by email when a new file is uploaded?

I'm just not sure how/where to get started on this.  Anyone know of a tutorial /script?  Or could you help me get startd from scratch?

Many thanks for your time and help .....

April

0
aprillougheed
Asked:
aprillougheed
  • 2
1 Solution
 
glcumminsCommented:
You can find a good file upload tutorial here:

http://www.tizag.com/phpT/fileupload.php

To make the filel available for download, just save the name of the file in a database. Then you can use something like this:

$fileLocation = "http://www.mysite.com/files/";

$query = "SELECT filename FROM files";
$result = mysql_query($query);

while ($row = mysql_fetch_object($result))
{
   ?><a href="<?php echo $fileLocation . $row->filename; ?>"><?php echo $row->filename; ?><br /><?php
}

This will display a list of files, and clicking a file will cause it to download.

The answers to your other questions are Yes:

 Can we identify the file using the file name?
 Can I list a last modified date for the file?
 Can a group of users be notified by email when a new file is uploaded?

However, they may be topics for a different question, and should probably be answered after you build your basic script.
0
 
aprillougheedAuthor Commented:
glcummins - I'm so sorry. I forgot this was open.  We ended up using Interakt Kollection. It is working great.  April
0
 
glcumminsCommented:
No problem at all. I'm glad you found something that works well for you!
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now