Solved

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

Posted on 2007-03-19
3
245 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
paypal ipn url 5 57
Fulfillment API php code sample 1 40
PHP PDO   How do I correctly remove record using DELETE FROM? 1 20
PHP not parsing ' character 12 39
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

770 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