https://github.com/salsify/multipartuploader
Small PHP library to make sending multipart uploads a little less painful.
https://github.com/salsify/multipartuploader
Last synced: 8 months ago
JSON representation
Small PHP library to make sending multipart uploads a little less painful.
- Host: GitHub
- URL: https://github.com/salsify/multipartuploader
- Owner: salsify
- License: mit
- Created: 2013-03-07T20:56:44.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-05-02T17:20:10.000Z (about 13 years ago)
- Last Synced: 2025-09-17T10:01:38.884Z (9 months ago)
- Language: PHP
- Size: 105 KB
- Stars: 2
- Watchers: 40
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
multipart uploader
========================
If you need to POST a multipart upload using PHP to some remote service, this will make your life much easier.
Usage
-----
```php
$uploader = new MultipartUploader_Uploader('http://example.com/');
$uploader->addPart('key', 'value');
$uploader->addPart('key2', 'value2');
$uploader->addFile('file', '/path/to/some/file.json', 'application/json');
$uploader->addFile('file2', '/path/to/some/sweet_image.jpg', 'image/jpeg');
$response = $uploader->postData();
```
`$response` is an instance of [`HttpMessage`](http://www.php.net/manual/en/class.httpmessage.php).
Limitations
-----------
The file contents are loaded into memory, so this may not be suitable for streaming huge post bodies over the wire.
TODO
----
* Guess the content type from the filename.
License
-------
[MIT License](http://mit-license.org/) (c) Salsify, Inc.