Open JefferyWong opened 8 years ago
There's a little mistake in your code:
$url = "upload url";
$params = ['file' => '@' . $_FILE['image']['tmp_name']];
$response = Request::post($url, $params, Mime::UPLOAD)->send(); // Notice the 2 colons (::) after Request
If that doesn't fix it, can you post the error you're getting? Nobody will be able to help you without a little more background.
Thank you. I've find the problem I got. PHP after version 5.6 doesn't surpport '@'.'file _path' to send file via curl. I have to use CurlFile Class to do that.
Hey @JefferyWong - would you mind sharing what you did to get this to work with Httpful? I am having an issue with the same thing. The file doesn't get into the $_FILES variable at all.
I got a file upload API in java which need a MuitipartFile request param I use Httpful send a file like $url = "upload url"; $params = ['file'=>'@'.$_FILE['image']['tmp_name']]; $response = Request:post($url, $params, Mime::UPLOAD)->send(); But didn't got what I want. Is my code has problem or something wrong about Httpfull? Wish somebody answer me, kind of in hurry. thanks.