Skip to main content

Upload and Download Files in PHP

Language


In this project you can learn here how to upload and download files using php. The user can only upload with this format pdf, txt, html, htm, exe, zip, doc, xls, ppt, gif, png, jpeg, jpg and php. Hope this will help you in your project.

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

Submitted byanony (not verified)on Fri, 07/21/2017 - 17:06

download function, there is no file downloaded. System prompt file not exist.

Submitted bynikosttttttt (not verified)on Thu, 02/15/2018 - 23:44

thank you very much

Submitted bykartik124 (not verified)on Sat, 03/24/2018 - 21:43

In reply to by nikosttttttt (not verified)

what changes you made in the download file

Submitted byPriyaSinha (not verified)on Wed, 04/04/2018 - 02:51

Thanks alot. It's woking fine.

Submitted byrookie (not verified)on Wed, 05/09/2018 - 03:05

Thank you so much for the code. You are the best!

Submitted byglen09090990 (not verified)on Wed, 05/23/2018 - 10:33

Hi, download button is not working, Please check. Thank you

Submitted byManish Pareek (not verified)on Thu, 06/20/2019 - 20:15

Just Change Line No 9 to

move_uploaded_file($temp,"upload/".$name);

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.