PHPackages                             pingevt/image\_api\_upload - 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. [Image &amp; Media](/categories/media)
4. /
5. pingevt/image\_api\_upload

ActiveDrupal-module[Image &amp; Media](/categories/media)

pingevt/image\_api\_upload
==========================

Drupal Module for uploading images with metadata.

1.x-dev(8mo ago)14GPL-2.0+PHPPHP ^8.1 || ^8.2 || ^8.3CI failing

Since Sep 1Pushed 8mo agoCompare

[ Source](https://github.com/pingevt/image_api_upload)[ Packagist](https://packagist.org/packages/pingevt/image_api_upload)[ RSS](/packages/pingevt-image-api-upload/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelogDependencies (4)Versions (1)Used By (0)

Image API Upload
================

[](#image-api-upload)

A flexible Drupal module for uploading images via a RESTful API endpoint. Supports configurable media bundle, image field, credit, caption, and taxonomy/tag fields. Handles file storage, media entity creation, and dynamic taxonomy term creation.

---

Features
--------

[](#features)

- Upload images to Drupal via HTTP POST (e.g., with `curl`)
- Configurable media bundle and fields (image, credit, caption, tags)
- Optional upload directory (validated and transliterated)
- Automatically creates taxonomy terms if they do not exist
- Stores settings in Drupal state (runtime, not config)
- Returns JSON response with media entity ID and upload directory

---

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

[](#installation)

1. Place this module in `web/modules/custom/image_api_upload`
2. Enable the module: `drush en image_api_upload`
3. Configure the module at `/admin/config/media/image-api-upload`

---

Configuration
-------------

[](#configuration)

Go to Configuration → Media → Image API Upload (`/admin/config/media/image-api-upload`) and select:

- Media bundle (e.g., "image")
- Image field (e.g., field\_media\_image)
- Credit field (e.g., field\_credit)
- Caption field (optional, e.g., field\_caption)
- Media Tags field (optional, taxonomy reference field)
- All settings are stored in Drupal state and can be changed at runtime.

---

API Usage
---------

[](#api-usage)

Endpoint

```
POST /image-api-upload/upload
```

### Parameters

[](#parameters)

NameTypeRequiredDescriptionimagefileYesThe image file to uploadnamestringNoMedia entity name/titlealtstringNoAlt text for the imagecreditstringNoCredit text for the imagecaptionstringNoCaption text for the image (if configured)upload\_dirstringNoOptional subdirectory for file storagemedia\_tagsstringNoComma-separated list of taxonomy---

Example: Upload an Image with Tags and Caption

```
curl -X POST http://your-drupal-site/image-api-upload/upload \
  -F 'image=@/path/to/image.jpg' \
  -F 'name=Sample Image' \
  -F 'alt=Alt text here' \
  -F 'credit=Photographer Name' \
  -F 'caption=This is a caption for the image.' \
  -F 'upload_dir=custom_uploads' \
  -F 'media_tags=Nature, UVA, Campus'
```

Response:

```
{
  "message": "Upload successful.",
  "media_id": 123,
  "directory": "public://custom_uploads"
}
```

---

Notes
-----

[](#notes)

The upload\_dir is sanitized and transliterated for safety.

If media\_tags are provided, terms are created in the configured vocabulary if they do not exist.

The API returns a JSON response with the new media entity ID and the directory used.

All settings are runtime (Drupal state), not config—no config export/import required.

---

Troubleshooting
---------------

[](#troubleshooting)

Ensure the media bundle and fields are configured before uploading. The user making the API call must have permission to create media entities and upload files. Check Drupal logs for errors if uploads fail.

---

License
-------

[](#license)

This project is licensed under the GNU General Public License, version 2 or later. See LICENSE.txt for details.

---

Maintainers
-----------

[](#maintainers)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance59

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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

259d ago

### Community

Maintainers

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

---

Top Contributors

[![pingevt](https://avatars.githubusercontent.com/u/3128823?v=4)](https://github.com/pingevt "pingevt (5 commits)")

### Embed Badge

![Health badge](/badges/pingevt-image-api-upload/health.svg)

```
[![Health](https://phpackages.com/badges/pingevt-image-api-upload/health.svg)](https://phpackages.com/packages/pingevt-image-api-upload)
```

###  Alternatives

[mindkomm/timmy

Advanced image manipulation for Timber.

17735.6k](/packages/mindkomm-timmy)[toinekamps/responsive-pics

Responsive Pics is a Wordpress tool for resizing images on the fly.

831.2k](/packages/toinekamps-responsive-pics)[asgardcms/media-module

Media module for AsgardCMS. Handles the media library.

1130.6k2](/packages/asgardcms-media-module)[globalis/wp-cubi-imagemin

Standalone image minification WordPress plugin

1317.7k2](/packages/globalis-wp-cubi-imagemin)[samwilson/diagrams

MediaWiki extension to display various types of diagrams rendered from text within wiki pages.

122.3k](/packages/samwilson-diagrams)[chkilel/icones-plugin

Access thousands of icons including popular icon sets, icon fonts and several Emoji sets from a backed Form Widget

181.6k](/packages/chkilel-icones-plugin)

PHPackages © 2026

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