Can I upload files and store them in my database?

Asked by:
almafly / 5 Points
2011-11-06 3:16 am EST
I created a small search engine for my site using php its connected to a data base. I also have a upload section on my site where people upload documents is there a way i can have the uploaded files go directly into my search engine database?

To ask this user for more information, please first login.

To submit an answer, please login.

Best answer chosen by Web Hosting Hub staff


13,688 Points
2011-11-07 5:41 pm EST
Hello almafly,

Excellent question about uploading files with PHP. While I'm happy to point you in the right direction for finding instructions on how to upload files to a database, I wanted to caution you regarding that practice first.

If you upload the actual files (not just file information) to the database, it may cause problems in the future for the server when you are trying to actually read those files from the database as that can be a very taxing process for the server. The best practice is to extract information about the file and store that information in the database while keeping the actual file stored in your account.

Here are links to the recommended method of uploading the file to the server and storing information about the file in a database:

If you decide to store the actual files in the database (not recommended) here are the links to instructions for that:

Please let us know if you have any questions or need any additional assistance.


Christi N.

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.