---
title: "Pterodactyl: upload size check in React and PHP | VulCode"
description: "A fix to the Pterodactyl game server panel: the React file manager checks the node upload limit before sending a file, and the PHP API now exposes that limit."
url: "https://vulcode.com/en/opensource/contributions/pterodactyl"
lang: "en"
---

[All contributions](https://vulcode.com/en/opensource/contributions)

pterodactyl/panel

# Pterodactyl

A free, open source game server management panel built with PHP, React and Go. Every game server runs in its own isolated Docker container.

[See the repository](https://github.com/pterodactyl/panel) [All contributions](https://vulcode.com/en/opensource/contributions)

- **Language**: PHP
- **GitHub stars**: 9,537
- **Merged changes**: 1
- **Project site**: [pterodactyl.io](https://pterodactyl.io)

## What we changed

The file manager rejects files over the node's upload limit before sending a single byte, instead of finding out after the whole file went up. The client API now exposes the node's upload_size field for this.

### What this work shows

- React hooks and TanStack Query

- Client-side file upload validation

- API contract between PHP and TypeScript

- Hook tests with Vitest and Testing Library

What was broken

### An oversized file rejected only after upload

The file manager found out that a file was over the node's upload limit only after sending all of it. With a large file, the user waited for the whole upload just to see an error.

How we fixed it

### A size check before the upload

ServerResource in the client API returns the node's upload_size, and the useFileUploader hook rejects larger files before a single byte goes out, showing a message with the file name or the number of files over the limit. Tests cover the rejection, the file count and uploading files within the limit.

[#7305](https://github.com/pterodactyl/panel/pull/7305)

## Merged change 1

- [#7305 Validate upload size against the node limit before uploading Merged 11 November 2026](https://github.com/pterodactyl/panel/pull/7305)

## What it taught us

A limit the server enforces is worth knowing in the browser too, so users do not wait for an upload that will be rejected anyway. Such a change runs through the whole path: the PHP API resource, the generated TypeScript types, the React hook and its tests.

[More about this technology: TypeScript, React and Node](https://vulcode.com/en/technologies/typescript-react-and-node)

## Other projects we write code for

- [**Material UI** JavaScript · 99,391 stars A React component library that implements Google's Material Design: ready-made text fields, selects, buttons and other interface elements.](https://vulcode.com/en/opensource/contributions/material-ui)

- [**Grafana** TypeScript · 78,050 stars An open observability and data visualisation platform that shows metrics, logs and traces from Prometheus, Loki, Elasticsearch, PostgreSQL and many other sources on dashboards.](https://vulcode.com/en/opensource/contributions/grafana)

- [**Marked** TypeScript · 37,323 stars A fast Markdown parser and compiler to HTML, written in TypeScript and following CommonMark and GitHub Flavored Markdown.](https://vulcode.com/en/opensource/contributions/marked)

- [**Autoprefixer** JavaScript · 22,197 stars A PostCSS plugin that adds browser prefixes to CSS based on Can I Use data, including the -ms-grid syntax for CSS Grid layouts.](https://vulcode.com/en/opensource/contributions/autoprefixer)

- [**Lichess** TypeScript · 19,013 stars The lichess.org chess server: free, ad-free and open source, focused on real-time play. The back end is written in Scala, the interface in TypeScript.](https://vulcode.com/en/opensource/contributions/lichess)

- [**compromise** JavaScript · 12,176 stars A natural language processing library in JavaScript: it splits text into sentences and words, tags parts of speech, conjugates verbs and inflects nouns, and reads dates through a plugin. It runs in the browser and in Node.js.](https://vulcode.com/en/opensource/contributions/compromise)

## Describe your project.

A free quote comes back within an hour during working hours.

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)
