How can I write the PHP + MYSQL file upload/download code?

Source: Internet
Author: User
How can I write the PHP + MYSQL file upload/download code? The graduation project should be a system for managing graduation thesis, requiring students to upload graduation thesis in doc format, and the tutor can download the thesis. how can I write the specific code?


Reply to discussion (solution)

We recommend that you search for this type of code online.

Upload is a form submission.


Processing the submitted form stores the uploaded file in a path, and then stores the path in the database,

Then, the paper path is presented to the tutor, who can download the paper as soon as he clicks it.

Check the usage of PHP's ultra-Global Array $ _ FILES

There are examples available in the manual

There are ready-to-use encapsulated file Upload classes on the Internet!

Student. php

 


Tutor. php
 ';}


This is the basic code. expand it yourself!

Submit the file in a form, access the database, and download the list link of the output file path (directly link to the specific file name) on the download end. then, you can download the file.

Filter to prevent security

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.