I uploaded the file using HTML / PHP, and the following is print_r () of the $ _FILES ['file'] array:
Array ( [name] => Chrysanthemum.jpg [type] => application/octet-stream [tmp_name] => G:\xampp\tmp\php82DB.tmp [error] => 0 [size] => 879394 )
As you can see above, the temporary file is stored in the tmp_name directory. I need to get this directory path using PHP. How to get it?
Tried to use sys_get_temp_dir() , but this is what returns me.
I do NOT want to get a directory from an array or from file upload data. I want to dynamically get the php file upload directory using a function.
C:\Users\admin\AppData\Local\Temp
php
Yash desai
source share