We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b3ef89 commit e742f0eCopy full SHA for e742f0e
examples/olddriver.gif
1.41 MB
examples/uploadfile.php
@@ -0,0 +1,26 @@
1
+<?php
2
+require '../vendor/autoload.php';
3
+
4
+use Hhxsv5\PhpMultiCurl\Curl;
5
6
+$postUrl = 'http://localhost/upload.php';//<?php var_dump($_FILES);
7
8
+$options = [//The custom the curl options
9
+ CURLOPT_TIMEOUT => 10,
10
+ CURLOPT_CONNECTTIMEOUT => 5,
11
+ CURLOPT_USERAGENT => 'Multi-Curl Client V1.0',
12
+];
13
+$c1 = new Curl($options);
14
15
+$file1 = new CURLFile('./olddriver.gif', 'image/gif', 'name1');
16
+$params = ['file1' => $file1];
17
+$c1->makePost($postUrl, $params);
18
+$ret = $c1->exec();
19
+var_dump($ret);
20
+if ($ret) {
21
+ //Success
22
+ var_dump($c1->getResponse());
23
+} else {
24
+ //Fail
25
+ var_dump($c1->getError());
26
+}
0 commit comments