Hi,
I have uploaded a file to my server, does anybody have example phpcode to save this file into a database, and then for me to get this from the database?

thanks

    What kind of file is it, and what type of data is in it?

      its never really a recommended aprouch to save files in databases. just save the path, and let the servers filesystem store the file.

        In general, its a bad idea to store files in the database, if you take a look at the MySQL and PostgreSQL manuals, they actually erccomend against it. The filesystem does a much better job of caching and handling the file than the database will.

        However, you can look at BLOB objects to store the binary data. www.mysql.com/blob

          23 days later

          Hi,

          its never really a recommended aprouch to save files in databases. just save the path, and let the servers filesystem store the file.

          Can somenone tell me how to store the path in the database?

          Regards

            Newladder, I hope you understant how to add data to a MySQL database using PHP.
            If yes you can upload the required file to a path of your choice and then add that path + the file name of the uploaded file to the MySQL database.

              Check out the php.net documentation, specifically regarding the $_FILE array.

                Write a Reply...