Can I upload files and store them in my database?

Asked by:
almafly
Time:
2011-11-06 12:16 am
Category:
Databases
Hits:
813
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?

You must login before you can ask a follow up question.

You must login before you can submit an answer.

Best answer chosen by Web Hosting Hub staff

0

ChristiNi
2011-11-07 1:41 pm
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:

http://php.about.com/od/phpwithmysql/ss/Upload_file_sql.htm

http://stackoverflow.com/questions/450876/upload-image-to-server-using-php-store-file-name-in-a-mysql-database-with-othe

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

http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/uploading-files-to-mysql-database.aspx

http://bytes.com/topic/php/insights/740327-uploading-files-into-mysql-database-using-php

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

Regards,

Christi N.

You must login before you can post a comment about this answer.

Like this Question?

Have a Question?

If you need some help, submit your question to our Community! We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)

Recent Questions

  1. Google Adwords Credit Link Doesn't Work in AMP
  2. my email is being rejected
  3. Can I run the FiverrScript on my hosting

Support Center Search

Current Customers

Email: support@WebHostingHub.com 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.