diff --git a/src/Httpful/Request.php b/src/Httpful/Request.php index db2dd9b..f287077 100644 --- a/src/Httpful/Request.php +++ b/src/Httpful/Request.php @@ -382,9 +382,12 @@ public function expectsType($mime) public function attach($files) { foreach ($files as $key => $file) { - $this->payload[$key] = "@{$file}"; + if (function_exists('curl_file_create')) { + $this->payload[$key] = curl_file_create($file); + } else { + $this->payload[$key] = "@{$file}"; + } } - $this->sendsType(Mime::UPLOAD); return $this; }