haricot has asked for the wisdom of the Perl Monks concerning the following question:
$curl = curl_init($apiUrl); $curlPostData = array( "force_post" => urlencode("true"), "auth_hash" => $authHash, "urlencoded_filename" => urlencode($fileName), "auth_token" => $authToken, "xhr_uploader" => urlencode("true"), 'userfile_0"; filename="fake-name"' => $fileDa +ta ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: mu +ltipart/form-data")); curl_setopt($curl, CURLOPT_USERPWD, $pydioRestUser . ":" . $py +dioRestPw); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curlPostData); $response = curl_exec($curl);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: curl postfields ( adaptation of php script)
by 1nickt (Canon) on Feb 28, 2017 at 17:30 UTC | |
|
Re: curl postfields ( adaptation of php script)
by Cow1337killr (Monk) on Mar 01, 2017 at 18:02 UTC |