From d91e1ad8855af5ebae2c547b2ca95468cfc49812 Mon Sep 17 00:00:00 2001 From: spirit Date: Fri, 13 Dec 2019 15:34:14 +0800 Subject: [PATCH] fix sm.ms upload --- inc/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/api.php b/inc/api.php index 394f284..5e2dfe0 100644 --- a/inc/api.php +++ b/inc/api.php @@ -225,8 +225,8 @@ function SMMS_API($image) $bits = file_get_contents($filedata); $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', - 'body' => '--' . $Boundary . '\r\nContent-Disposition: form-data; name="smfile"; filename="' . $filename . '"\r\n\r\n'.$bits.'\r\n\r\n--' . $Boundary . '--' + "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--" ); $response = wp_remote_post($upload_url, $args);