If you using MySQL database and want to store files in database, you need to create BLOB columns, which can holds up to 65,535 characters. Here is a sample script that creates a table with a BLOB column to be used to store uploaded files:<?php $con = mysql_connect("localhost", "", ""); mysql_select_db("fyi"); $sql = "CREATE TABLE fyi_files (" . " id INTEGER NOT NULL AUTO_INCREMENT" . ", name VARCHAR(80) NOT NULL" . ", type VARCHAR(80) NOT NULL" . ", size INTEGER NOT NULL" . ", content BLOB" . ", PRIMARY KEY (id)" . ")"; mysql_query($sql, $con); mysql_close($con); ?>
PHP
Topic: File Upload
How To Create a Table To Store Files?
Browse random answers:
What Is File Upload?
Which HTML Tag Allows Users to Specify a File for Uploading?
How To Write the FORM Tag Correctly for Uploading Files?
How To Get the Uploaded File Information in the Receiving Script?
How To Process Uploaded Files?
How To Move Uploaded Files To Permanent Directory?
How To Detect File Uploading Errors?
Why Do You Need to Filter Out Empty Files?
How To Create a Table To Store Files?
How To Upload Files into Database?
What Are the File Upload Settings in Configuration File?