How to get the httppost filename on the php server -


i used fileentity httppost post file php apache server,but not want change name of file.

how can name of file server using php? have file: $filename='test.zip';//自定义的名字 file_get_contents('php://input'); file_put_contents($filename,$data);

html (test.html):

<!-- make sure have enctype , name on file input --> <form method="post" action="test.php" enctype="multipart/form-data">     <input type="file" name="test" />     <button>submit</button> </form> 

php (test.php):

// since we've set our file input name 'test' ,  // we've posted form-data, can use $_files  print_r( $_files['test'] ); 

just use $_files.

array (     [name] => test.jpg     [type] => image/jpeg     [tmp_name] => /tmp/pasd41l3fmfr     [error] => 0     [size] => 15476 ) 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -