Skip to content

Commit

Permalink
Merge pull request #123 from Artistan/master
Browse files Browse the repository at this point in the history
Fix for new curl file upload method.
  • Loading branch information
nategood committed Mar 26, 2014
2 parents f4233fe + 9eecc29 commit a92be3a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Httpful/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit a92be3a

Please sign in to comment.