I am trying to upload a file from my webserver to a remote server via a POST form. The problem is that the postData appears to get dropped by libCurl. It is sending headers with a content length of 0. I have tried using a string instead of an array, but the file is not passed just the path to it.

PHP Code:
    $postData = array();
    
//simulates <input type="file" name="file_name">
    
$postData'submit' ] = "Upload";
    
$postData'var1' ] = "1048576";
    
$postData['var2'] = $var2;
    
$postData['var3'] = $var3;
    
$postData['var4'] = $var4;
    
$postData'file' ] = "@$file";
    
$url "path.to/upload.form";
    
$ch curl_init();
    
curl_setopt($chCURLOPT_URL$url );
    
curl_setopt($chCURLOPT_RETURNTRANSFER,1);
    
curl_setopt($chCURLOPT_POST);
    
curl_setopt($chCURLOPT_POSTFIELDS$postData);
    
curl_setopt($chCURLOPT_VERBOSETRUE);
    
curl_setopt($chCURLOPT_HEADERFALSE);
    
//curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    
curl_setopt($chCURLOPT_USERAGENT"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041214 Firefox/1.0");
    
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
    
curl_setopt($chCURLOPT_SSL_VERIFYHOSTFALSE);
    
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
    
curl_setopt($chCURLOPT_COOKIE$cookie);
    
curl_setopt($chCURLOPT_REFERER"path.to/upload.form");
    
$rtnValue curl_exec($ch);
    
curl_close($ch);