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(10mo ago)16GPL-2.0+PHPPHP ^8.1 || ^8.2 || ^8.3CI failing

Since Sep 1Pushed 10mo 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 today

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

27

—

LowBetter than 47% of packages

Maintenance54

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

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

305d 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

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[govcms/govcms

GovCMS Drupal Distribution

198102.2k3](/packages/govcms-govcms)[mindkomm/timmy

Advanced image manipulation for Timber.

17737.8k](/packages/mindkomm-timmy)[wp-media/imagify-plugin

Image optimization plugin for WordPress by WP Media.

8067.5k](/packages/wp-media-imagify-plugin)[pressbooks/pressbooks-book

This theme is named after Canadian media theorist Marshall McLuhan, who coined the phrase “the medium is the message.” It is designed for academic writing and is also suitable for fiction. Headings are set in Cormorant Garamond, and body type is set in Lora.

216.7k](/packages/pressbooks-pressbooks-book)[fourkitchens/sous-drupal-project

Starter project for Sous a Drupal distribution featuring a theme based on Emulsify Design System.

141.1k](/packages/fourkitchens-sous-drupal-project)

PHPackages © 2026

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