From c87d6613626c5146597b02421d9119e4fd1a0117 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Thu, 13 Dec 2018 13:07:51 +0900 Subject: [PATCH] Update webpagetool.php --- helper/webpagetool.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/helper/webpagetool.php b/helper/webpagetool.php index 168a878..26a3af6 100644 --- a/helper/webpagetool.php +++ b/helper/webpagetool.php @@ -249,8 +249,18 @@ if(!function_exists("get_web_curl")) { if(count($data) > 0) { if($method == "post") { + foreach($data as $k=>$v) { + if(substr($v, 0, 1) == "@") { // if this is a file + if(function_exists("curl_file_create")) { // php 5.5+ + $data[$k] = curl_file_create(substr($v, 1)); + } else { + $data[$k] = "@" . realpath(substr($v, 1)); + } + } + } + $options[CURLOPT_POST] = 1; - $options[CURLOPT_POSTFIELDS] = get_web_build_qs("", $data); + $options[CURLOPT_POSTFIELDS] = $data; } if($method == "get") {