A blog on museum-digital and the broader digitization of museum work.
A warning will be shown if a user tries to upload more files than allowed in one go

A lighter is an object. With one, or maybe two perspectives – images. A book is an object. With potentially hundreds of pages – images.

To simplify the management of objects with many images musdb offers the option to upload multiple images at a time. This option is however limited by global server settings like the maximum size of uploads and the maximum number of files that can be uploaded in one go.

To understand the problem, it’s important to know that most tools of museum-digital are written in PHP. Unfortunately, PHP has a tendency to gloss over potential errors and continue without enforcing that the problem to be solved either by the programmer solving a bug or by the user not doing a certain action.

The maximum number of files that can be uploaded simultaneously is a flagrant case of this: Rather than inform the user of their overstepping of the set upload limitations, PHP accepts files until the number of allowed files per upload is reached. Any files after are simply ignored.

Say a user attempts to upload 30 pages of a book in one go. The first 20 will be uploaded correctly, while the last 10 will be skipped. In the worst case, the user doesn’t even notice the missing data. In a better case, they are left confused.

We have thus added a warning that stops the user before submitting the upload form when trying to upload more files than allowed.