PHP code example of ar414 / curl-upload-binary-image
1. Go to this page and download the library: Download ar414/curl-upload-binary-image library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ar414 / curl-upload-binary-image example snippets
r414\UploadBinaryImage;
$url = 'http://0.4.1.4:414/upload?path=/test/';
$fields = [];
$fieldName = 'file';
$fileName = 'ar414.png';
$fileBody = file_get_contents('https://github.com/ar414-com/ar414-com/raw/master/assets/ar414.png');
$ret = UploadBinaryImage::upload($url,$fields,$fieldName,$fileName,$fileBody);
var_dump($ret);