You want to allow files to be uploaded your web server and stored in your database.
Present the user with a web form that includes a file field. Use a file field in a web form. When the user submits the form, extract the file and store it in MySQL.
One special kind of web input is an uploaded file. A file is sent as
part of a
POST request, but it’s
handled differently than other
because a file is represented by several pieces of information such
as its contents, its MIME type, its original filename on the client,
and its name in temporary storage on the web server host.
To handle file uploads, you must send a special kind of form to the user; this is true no matter what API you use to create the form. However, when the user submits the form, the operations that check for and process an uploaded file are API-specific.
To create a form that allows files to be uploaded, the opening
<form> tag should specify the
POST method and must also include an
enctype (encoding type) attribute with a value of
<form method="POST" enctype="multipart/form-data" action="
If you don’t specify this kind of encoding, the form
will be submitted using the default encoding type
application/x-www-form-urlencoded) and file
uploads will not work properly.
To include a file upload field in the form, use an
<input> element of type
file. For example, to present a 60-character file
upload_file, the element ...