0

this is the code that I have used to upload a zip file and other data to another page.There is a problem that if I try to send file and post data at the same time ,the other page will not get post data and If I remove the line which send file ,other form data would be posted . Here is the code:

$ch = curl_init();
curl_setopt($ch,CURLOPT_HEADER,0);
curl_setopt($ch,CURLOPT_VERBOSE,0);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POST,true);
curl_setopt($ch,CURLOPT_URL,$url);
$post_array = array(

    "upload" => "Upload",'s_id' => stripcslashes($s_id),
    'u' => 'persian',
     "my_file" => '@'.dirname(__file__)."/downloads/1393-11-14_1_7.zip"
    );
curl_setopt($ch,CURLOPT_POSTFIELDS,$post_array);
$response = curl_exec($ch);

The zip file and url is correct and there is no error from curl.Also the $url is correct and I get response from that page. What's wrong?

user970956
  • 319
  • 1
  • 5
  • 13

0 Answers0