fix sm.ms upload

This commit is contained in:
spirit 2019-12-13 15:34:14 +08:00
parent 15a6ab525b
commit d91e1ad885
1 changed files with 2 additions and 2 deletions

View File

@ -225,8 +225,8 @@ function SMMS_API($image)
$bits = file_get_contents($filedata); $bits = file_get_contents($filedata);
$args = array( $args = array(
'headers' => 'Content-Type: multipart/form-data; boundary=' . $Boundary . '\r\n\r\nAuthorization: Basic ' . $client_id . '\r\n\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97', "headers" => "Content-Type: multipart/form-data; boundary=$Boundary\r\n\r\nAuthorization: Basic $client_id\r\n\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97",
'body' => '--' . $Boundary . '\r\nContent-Disposition: form-data; name="smfile"; filename="' . $filename . '"\r\n\r\n'.$bits.'\r\n\r\n--' . $Boundary . '--' "body" => "--$Boundary\r\nContent-Disposition: form-data; name=\"smfile\"; filename=\"$filename\"\r\n\r\n$bits\r\n\r\n--$Boundary--"
); );
$response = wp_remote_post($upload_url, $args); $response = wp_remote_post($upload_url, $args);