Does upload_tmp_dir need to be set for BLOB uploads to work?

software development


Hey there,

First off, thanks for any help you can provide me on this question. I’m fairly new to PHP, and I am trying to write a script that will process uploaded files and insert them as BLOB data in my MySQL database. All of the tutorials I’ve found on line make this look really straightforward, but I’m running into walls when it comes to actually getting the file moved in the db.

Is the because I haven’t customized my php configuration?

According to phpinfo, file_uploads is on and upload_temp_dir is “no value”.

Thanks much for your help!



Well, I have got it to work, without setting upload_temp_dir. I used the sample code here:, just in case anyone else runs into the same problem.

I think the problem with my other code samples involved setting the global variables. What finally wound up working for me were the following lines:

$fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type'];

Hope that helps someone.