Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-03-19
3
Medium Priority
?
278 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
glcummins earned 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …
Suggested Courses

618 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