Solved

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

Posted on 2007-03-19
3
234 Views
Last Modified: 2008-02-01
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
Comment
Question by:aprillougheed
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
glcummins earned 500 total points
ID: 18748606
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
 

Author Comment

by:aprillougheed
ID: 18803460
glcummins - I'm so sorry. I forgot this was open.  We ended up using Interakt Kollection. It is working great.  April
0
 
LVL 24

Expert Comment

by:glcummins
ID: 18803474
No problem at all. I'm glad you found something that works well for you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now