Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atomjoy/curlsendfile
Php curl upload class.
https://github.com/atomjoy/curlsendfile
curl php php-curl php-oop php7 post upload upload-images
Last synced: 18 days ago
JSON representation
Php curl upload class.
- Host: GitHub
- URL: https://github.com/atomjoy/curlsendfile
- Owner: atomjoy
- Created: 2019-12-21T14:50:00.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T15:06:06.000Z (8 months ago)
- Last Synced: 2024-10-12T10:31:43.696Z (3 months ago)
- Topics: curl, php, php-curl, php-oop, php7, post, upload, upload-images
- Language: PHP
- Homepage:
- Size: 71.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CurlSendFile Php class
Send big files with php curl### Set php.ini
```bash
# In php.ini only
file_uploads = On
allow_url_fopen = Off
allow_url_include = Off# In php.ini or in .user.ini in local directory
max_execution_time = 40000max_input_time = 40000
max_input_vars = 100upload_max_filesize = 900M
post_max_size = 900M
```
### Send file with curl
```php
Send("http://localhost/example/upload.php", 'example/img/wolf.jpg', ['my_post_id' => '1234567890', 'name' => 'Curl upload']);
// Params
$timeout = 60; // Timeout default: 60
$selfsigned = 1; // Allow selfsigned ssl 1 or 0 default: 1
$attr = 'my_file'; // Files form name $_FILES['my_file'] default: file
// Send with custom field name
echo $curl->Send("https://localhost/example/upload.php", 'example/img/wolf.jpg', ['id'=>'1234567890'], $timeout, $selfsigned, $attr);
}
catch(Exception $e)
{
echo $e->getMessage();
echo $e->getCode();
}
?>
```### Composer require
Install from command line (not active)
```bash
# Add
composer require atomjoy/curlsendfile# Or
composer require atomjoy/curlsendfile:1.0
composer require atomjoy/curlsendfile:stable# Install, update
composer update# If you need to update the autoloader
composer dump-autoload -o
```Install library from composer.json
```json
{
"name": "acme/blog",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/atomjoy/curlsendfile"
}
],
"require": {
"atomjoy/curlsendfile": "~1.0"
}
}
```