[Solved] Uploading a file to Google Signed URL with PHP cURL

this is what you want: remove CURLOPT_POSTFIELDS altogether, and replace CURLOPT_CUSTOMREQUEST=>’PUT’ with CURLOPT_UPLOAD=>1 and replace ‘r’ with ‘rb’, and use CURLOPT_INFILE (you’re supposed to use INFILE instead of POSTFIELDS), $fp = fopen($_FILES[‘file’][‘tmp_name’], “rb”); curl_setopt_array($ch,array( CURLOPT_UPLOAD=>1, CURLOPT_INFILE=>$fp, CURLOPT_INFILESIZE=>$_FILES[‘file’][‘size’] )); This works when I had $file = fopen($temp_name, ‘r’); never use the r mode, always use the … Read more