All 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.

Language
PHP
GitHub stars
9,537
Merged changes
1
Project site
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

Merged change 1

  1. #7305 Validate upload size against the node limit before uploading Merged 11 November 2026

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

Other projects we write code for

Describe your project.

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