0

Here is the CURLINFO_HEADER_OUT from PHP Curl Call-

"GET \/api\/v2\/file\/upload?token=c3344fd7d60f3e6587308f55e3aed0f7&name=Client3.php&hash=ccb1fac3110514a2039b5da707717f81&size=15390 HTTP\/1.1\r\nHost: rapidgator.net\r\nAccept: *\/*\r\n\r\n" 

Now how can I change this into Bash Curl to upload a file?

My attempt is-

FileUploadResponse=$(curl -H "CURLOPT_HEADER:false" -H "CURLOPT_RETURNTRANSFER:true" "$BaseURL"'file/upload?token='"$Token"'&hash='"$Hash"'&size='"$FileSize"'&name='"$FileName"|grep -E 'response') echo $FileUploadResponse 
7
  • Why do you keep switching from single to double quotes, instead of just putting the entire argument in double quotes? Commented Apr 25, 2019 at 20:17
  • CURLOPT_HEADER and CURLOPT_RETURNTRANSFER are not HTTP headers. Commented Apr 25, 2019 at 20:18
  • Can you please make an example? Commented Apr 25, 2019 at 20:18
  • Like this: "${baseURL}file/upload?token=$Token&hash=$Hash" Commented Apr 25, 2019 at 20:19
  • My Bash Curl Call may not reflect the PHP Curl Call. Commented Apr 25, 2019 at 20:21

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.