ar414/curl-upload-binary-image

PHP upload binary image data via CURL

v1.0.0 2020-11-11 06:42 UTC

This package is auto-updated.

Last update: 2024-11-11 15:44:37 UTC


README

PHP upload binary image data via CURL

Install

composer require ar414/curl-upload-binary-image

Usage

<?php

require_once '../vendor/autoload.php';

use Ar414\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);