php - Using c_url upload file to remote host, file name is incorrect -


using c_url upload file remote host. here code.

 <?php  /* http://localhost/upload.php: print_r($_post); print_r($_files); */  $ch = curl_init();  $data = array('name' => 'foo', 'file' => '@/home/autouvl/public_html/asmallorange/log.txt');  curl_setopt($ch, curlopt_url, 'http://www.test.com/test/receivefile.aspx'); curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields, $data);  echo(curl_exec($ch)); ?>  

question: in receivefile.aspx. got file name "/home/autouvl/public_html/asmallorange/log.txt". want should "log.txt", not full path. file can uploaded except incorrect file name.

what's wrong in code?

thank you!

$data = array('name' => 'foo', 'file' => '@/home/autouvl/public_html/asmallorange/log.txt;filename=log.txt'); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -