PHPackages                             imnotjames/curlfile-compat - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. imnotjames/curlfile-compat

AbandonedArchivedLibrary[HTTP &amp; Networking](/categories/http)

imnotjames/curlfile-compat
==========================

Compatibility library with CURLFile from PHP 5.5

0.0.1(11y ago)34.9k↓33.3%1MITPHP

Since Jun 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/imnotjames/curlfile-compat)[ Packagist](https://packagist.org/packages/imnotjames/curlfile-compat)[ Docs](https://github.com/imnotjames/curlfile-compat)[ RSS](/packages/imnotjames-curlfile-compat/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (1)

CURLFile Compatibility Library
==============================

[](#curlfile-compatibility-library)

[![Build Status](https://camo.githubusercontent.com/7a210fb833714a3a461eddae39b742af1b92e022343a6813d11169f2c5539932/68747470733a2f2f7472617669732d63692e6f72672f696d6e6f746a616d65732f6375726c66696c652d636f6d7061742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/imnotjames/curlfile-compat)[![Coverage Status](https://camo.githubusercontent.com/0afe22945eb05773c7d7d1f16dfd9753f8769633c13b0b9ff8d8b3dc3218cc7a/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f696d6e6f746a616d65732f6375726c66696c652d636f6d7061742e737667)](https://coveralls.io/r/imnotjames/curlfile-compat)

Compatibility library to add a [CURLFile](http://php.net/class.curlfile) class to older versions of PHP. [The RFC](https://wiki.php.net/rfc/curl-file-upload) has some more information on it as well.

This class abuses the fact that the PHP `CURLOPT_POSTFIELDS` option will coerce classes to strings when sending it as data, and outputs the older style of including files in the post data.

Installation
------------

[](#installation)

New school or old school, your choice.

For a new school installation with [Composer](http://getcomposer.org) simply [add it to your list of dependencies.](https://packagist.org/packages/imnotjames/curlfile-compat)

If you're kicking it old school you've got to `require` `src/CURLFile.php` and `src/imnotjames/CURLFILE.php`.

Either way, the non-namespaced CURLFile will only be created if the class doesn't already exist. Same goes for the `create_curl_file` function.

Usage
-----

[](#usage)

Exactly the same as [PHP's CURLFile'](http://php.net/curlfile)

```
$handle = curl_init('http://example.com');

$cfile = new CURLFile('puppy.jpg','image/jpeg','puppy_boquet');

// Assign POST data
$data = array('test_file' => $cfile);

curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);

curl_exec($handle);
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4334d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d856173bde55dfea1af31eacd0677a01f2eb44c0f8b2ebaf406c5c1c6dc8d5f3?d=identicon)[imnotjames](/maintainers/imnotjames)

---

Top Contributors

[![imnotjames](https://avatars.githubusercontent.com/u/1551593?v=4)](https://github.com/imnotjames "imnotjames (14 commits)")

---

Tags

curlfile-uploadcurlfile

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/imnotjames-curlfile-compat/health.svg)

```
[![Health](https://phpackages.com/badges/imnotjames-curlfile-compat/health.svg)](https://phpackages.com/packages/imnotjames-curlfile-compat)
```

###  Alternatives

[rmccue/requests

A HTTP library written in PHP, for human beings.

3.6k34.5M253](/packages/rmccue-requests)[kriswallsmith/buzz

Lightweight HTTP client

2.0k31.3M438](/packages/kriswallsmith-buzz)[nategood/httpful

A Readable, Chainable, REST friendly, PHP HTTP Client

1.8k17.2M266](/packages/nategood-httpful)[mashape/unirest-php

Unirest PHP

1.3k9.7M160](/packages/mashape-unirest-php)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48247.0M383](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

83510.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
