How do I get the PHP Uploads directory?

后端 未结 3 1018
予麋鹿
予麋鹿 2021-02-14 04:03

I have uploaded a file using HTML / PHP and following is the print_r() of the $_FILES[\'file\'] array:

Array
(
    [name] => Chrysanthemum.jpg
    [type] =>         


        
相关标签:
3条回答
  • 2021-02-14 04:49
    $tmp_dir = ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir();
    
    0 讨论(0)
  • 2021-02-14 05:03
    $upload_dir = ini_get('upload_tmp_dir');
    
    0 讨论(0)
  • 2021-02-14 05:03

    Php file upload temporary directory is a php config variable located on php.ini file.

    You can get the variable config value by using ini_get function.

    $path = ini_get('upload_tmp_dir'); // your code here

    0 讨论(0)
提交回复
热议问题