If I have to insert this info into a database, is it possible to retrieve the contents of the file using above information? I am wondering how would someone retrieve the file from the database ?
This is good at PHP level. I can see the content of txt file using this and some messed up characters in case of PDF and Word doc. I am wondering if I have to store this information into a database. Would it be a good idea to send this string into the database? I wonder how the database person would be able to retrieve it back.
tmp-files are deleted after the request. So the information is pretty useless, because the file does not exist anymore. The “database person” would receive this information by connecting and querying, just like any other database operation.
You can save files in the database, this way has multiple pros and cons you can read in seveal online ressources. Many databases have a special “binary” column type for that, and you can read/write them with the default filesystem functions. But in most situations it is more efficient to store files within the filesystem and just save the path in the database.