将文件从表单上传到远程服务器并仍在本地捕获其他输入?

I have a form with a few text inputs and a file upload field. It's action is to a remote server which is where the file is uploaded, a hidden field contains a redirect URL which is posted to the remote server. It redirects to this URL with a few parameters in the URL which I use $_GET to receive details about the file uploaded to the server.

I need to capture the other field values before the file is uploaded, as well as capture the response values sent back from the remote server.

I know I can use AJAX to post to a local php file to handle the post and use $_POST to capture the input values but i'm not able to upload the file remotely.

My uploadfile.php uses cURL. I posted the form fields to it with AJAX but it doesn't work because of AJAX security and remote posting.

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,$UPLOAD_URL."&");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
            'UPLOAD_IDENTIFIER='.$UPLOAD_IDENTIFIER.'&extra_info='.$extra_info.'&userfile='.$userfile);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$upload_info = curl_exec ($ch);
curl_close ($ch);

Is there a way to let the form submit normally to the remote server, and capture the other fields? Maybe have them placed into session variables so when the redirect page loads with the parameters in the URL I get get those and work with all the input fields and response from remote server?