Skip to content
Skills Library
Documents & office · Conversion & formats

upload-files

/upload-files

Turn local files or user attachments into public URLs by uploading them to the Gradio server, so tools that require http(s) URLs (htr_transcribe, the viewer) can reach them. Use when you have local images or ALTO/PAGE XML — an attachment or a file path — but a tool needs a URL.

Repository
ra-mcp ↗
Licence
Apache-2.0
Last repository change
21.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
4
Deprecation

No signals detected. Repository changed on 21.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Turn local files or user attachments into public URLs by uploading them to the Gradio server, so tools that require http(s) URLs (htr_transcribe, the viewer) can reach them. Use when you have local images or ALTO/PAGE XML — an attachment or a file path — but a tool needs a URL.

Original author description

Turn local files or user attachments into public URLs by uploading them to the Gradio server, so tools that require http(s) URLs (htr_transcribe, the viewer) can reach them. Use when you have local images or ALTO/PAGE XML — an attachment or a file path — but a tool needs a URL.

How it works

  1. When to use
  2. Server URL
  3. Upload workflow
  4. Batch upload
  5. Supported file types
  6. After uploading
  7. Error handling
Original SKILL.md headings · 108 lines, 425 words
SKILL.md preview
---
name: upload-files
description: >
  Turn local files or user attachments into public URLs by uploading them to the
  Gradio server, so tools that require http(s) URLs (htr_transcribe, the viewer)
  can reach them.
  Use when you have local images or ALTO/PAGE XML — an attachment or a file path —
  but a tool needs a URL.
---

# Upload Files

Upload local files or user-provided attachments (images, XML, etc.) to the
Gradio server so they become publicly accessible URLs. These URLs can then
be passed to tools like `htr_transcribe` or the document viewer.

## When to use

- User has attached images or XML files in the conversation
- User has local file paths that need to be accessible by a remote tool
- Any tool requires http/https URLs but you only have local data

If you already have http/https URLs (e.g. IIIF links, public image URLs),
skip this skill entirely and pass them directly to the target tool.

## Server URL

The upload target is the Gradio Space that backs the HTR MCP server:

```
https://riksarkivet-htr-demo.hf.space
```

Override with the `HTR_SPACE_URL` environment variable if set.

## Upload workflow

### Step 1: Save attachments to disk

If the user attached files in the conversation (not already on disk), save
them first. Claude attachments are available as content in the conversation
— write them to temporary files.

### Step 2: Upload each file

For each file, POST to the Gradio upload endpoint:

```bash
curl -s -X POST "https://riksarkivet-htr-demo.hf.space/gradio_api/upload" \
  -F "files=@/path/to/filename.jpg"
```

Response is a JSON array of server paths:

```json
["/tmp/gradio/abc123def/filename.jpg"]
```

### Step 3: Construct public URLs

For each server path returned, construct the public URL:

```
https://riksarkivet-htr-demo.hf.space/gradio_api/file=/tmp/gradio/abc123def/filename.jpg
```

Pattern: `{base_url}/gradio_api/file={server_path}`

### Step 4: Collect all URLs

Gather all constructed URLs before passing them to the target tool.
Present the URLs to the user so they can verify the uploads succeeded.

## Batch upload

You can upload multiple files in a single request:

```bash
curl -s -X POST "https://riksarkivet-htr-demo.hf.space/gradio_api/upload" \
  -F "files=@page1.jpg" \
  -F "files=@page2.jpg" \
  -F "files=@page3.jpg"
```

Response:

```json
[
  "/tmp/gradio/abc123/page1.jpg",
  "/tmp/gradio/abc123/page2.jpg",
  "/tmp/gradio/abc123/page3.jpg"
]
```

Prefer batch upload over individual uploads when possible.

## Supported file types

| Type | Extensions | Use with |
|------|-----------|----------|
| Images | `.jpg`, `.jpeg`, `.png`, `.tif`, `.tiff` | `htr_transcribe`, document viewer |
| ALTO XML | `.xml` | document viewer (text layer overlay) |
| PAGE XML | `.xml` | document viewer (text layer overlay) |

## After uploading

Once you have public URLs, pass them to the appropriate tool:

- **HTR transcription**: call `htr_transcribe` with `image_urls=[...]`
- **Document viewer**: call `view_document` with `image_urls=[...]` and optionally `text_layer_urls=[...]`

## Error handling

- **Connection error**: the Gradio Space may be sleeping. Retry after 30 seconds.
- **413 Payload Too Large**: file exceeds the server limit. Try uploading fewer files per request.
- **Empty response**: verify the file path is correct and the file exists.

Versions

RepositoryScoreLicence
This page · ai-riksarkivet/ra-mcp100Apache-2.0
imagekit-developer/skills100MIT

Database snapshot: 13.11.2026 · package version 89b2ae2ebb18 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100confluence-attachment
    Manage file attachments - upload, download, list, and delete attachments. ALWAYS use when user wants to work with files on pages.
  • 100qubrics-attachments
    Use Qubrics attachment workflows without wasting model context on base64. Use when uploading, downloading, reading, forwarding, or sending email attachments through Qubrics MCP, CLI, SDKs, or direct HTTP, especially when choosing file_path vs presigned upload URL vs inline…
  • 90Linear Attachments
    This skill should be used when uploading files to Linear, linking external URLs as attachments, or downloading existing attachments with auth. Activates on "linear attachment", "linear file upload", "fileUpload mutation", "attachmentLinkCreate".
  • 100github-image-upload
    Upload local images and other files (PDF, zip, log, …) to GitHub and embed them in a pull request description, an issue, or a comment — producing canonical github.com/user-attachments URLs (private-repo uploads stay private). Use when asked to "attach a screenshot to the PR",…
  • 100pic-upload
    Upload local image files to image hosting via PicGo Server and return permanent CDN URLs. Use when needing to upload screenshots, generated images, or any local image file to get a permanent image hosting link. Triggers on upload image, picgo upload, picUpload, or whenever a…
  • 100image-upload
    scan a document's local image references and upload to ImgBB / Freeimage / UploadMe / ImgLink, replacing links in-place. Use when the user says "上传图片", "replace local image links", "全量转存", "mirror images", "scan and upload images", "图床化".

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.