GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Large Image files and hard coded php memory_limit crashes site · Issue #145 · projectsend/legacy

Large Image files and hard coded php memory_limit crashes site #145

New issue
Copy link
New issue
Copy link
Open
Open
Large Image files and hard coded php memory_limit crashes site#145
Copy link

Description

@chico11mbit
chico11mbit
opened on May 7, 2026
Issue body actions

Description

Hi,
when uploading large image files over 512MB (JPG,TIF, PSD etc.) the site crashes after upload (white page).
It crashed also when a large JPG with more than 40K pixel width is uploaded and it is under the memory_limit.

It seems that this is connected to the hardcoded memory limit 512MB in /config/php/projectsend.ini
I think the system is trying to create thumbnails from the uploaded files and crashes because of the filesize and the memory limit.

Steps to Reproduce

create large tif over 512MB
Upload it

Expected Behavior

Should bypass the thumbnail creation.

Actual Behavior

site crashes

ProjectSend Version

r2029 (docker)

PHP Version

latest (docker)

Database Type

MariaDB

Database Version

No response

Web Server

No response

Browser

No response

Relevant Log Output

Screenshots

No response

Activity

  1. chico11mbit
    changed the title [-]Large Image files andc hard coded php memory_limit crashes site[/-] [+]Large Image files and hard coded php memory_limit crashes site[/+] on May 7, 2026
  2. ignacionelson
    transferred this issue fromprojectsend/projectsendon Aug 10, 2026
  3. rcs27 commented on Sep 28, 2026

    @rcs27
    rcs27
    on Sep 28, 2026
    More actions

    Workaround that fixed this issue for me

    I ran into what appears to be the same issue on my ProjectSend installation.

    In my case, everything worked normally until a client uploaded some large/high-resolution JPG images. After that, certain pages started returning a 500 error.

    What made it confusing was that the files themselves were fine. They could be downloaded without any problem, and PDFs also worked normally.

    After some testing, I found that the 500 error was happening when ProjectSend tried to generate image thumbnails and read the image dimensions.

    My PHP memory_limit is 128M. Instead of increasing it, I decided to disable thumbnail/dimension processing for images since I don't really need image previews in this portal.

    This fixed the problem completely for me.

    Files I changed

    I had to make the change in three places:

    1. The client file list template (template.php used by my_files)
    2. manage-files.php
    3. includes/forms/file_editor.php

    The exact path of the client template may be different depending on the template being used.


    1. Client file list / template.php

    I removed/disabled the code that gets image dimensions:

    if (file_is_image($file->full_path)) {
        $dimensions = $file->getDimensions();
    
        if (!empty($dimensions)) {
            $title_content .= '<br><div class="file_meta"><small>' .
                $dimensions['width'] . ' x ' .
                $dimensions['height'] . ' px</small></div>';
        }
    }

    I also stopped generating thumbnails for images.

    Instead of calling make_thumbnail() for images, I only keep the normal Preview button for non-image files:

    $preview_cell = '';
    
    if ($file->expired == false) {
        if (!$file->isImage() && $file->embeddable) {
            $preview_cell =
                '<button class="btn btn-warning btn-sm btn-wide get-preview" ' .
                'data-url="' .
                BASE_URI .
                'process.php?do=get_preview&file_id=' .
                $file->id .
                '">' .
                __('Preview', 'cftp_admin') .
                '</button>';
        }
    }

    2. manage-files.php

    I did basically the same thing here.

    I removed/disabled the image thumbnail block that calls:

    make_thumbnail(
        $file->full_path,
        'proportional',
        300,
        300,
        90
    );

    Then I changed the preview logic so that images don't generate thumbnails, while non-image files can still use the normal preview:

    $preview_cell = '';
    
    if (!$file->isImage() && $file->embeddable) {
        $preview_cell =
            '<button class="btn btn-warning btn-sm btn-wide get-preview" ' .
            'data-url="' .
            BASE_URI .
            'process.php?do=get_preview&file_id=' .
            $file->id .
            '">' .
            __('Preview', 'cftp_admin') .
            '</button>';
    }

    I also disabled the image dimension lookup:

    $dimensions = $file->getDimensions();

    3. includes/forms/file_editor.php

    This one was important because editing a large JPG would also result in a 500 error.

    The file editor was generating a larger thumbnail with:

    make_thumbnail(
        $file->full_path,
        'proportional',
        400,
        400,
        90
    );

    It was also reading the image dimensions with:

    $file->getDimensions();

    I disabled both operations for images.

    One thing worth mentioning: make sure you are editing the correct file.

    On my installation, the file actually used by the editor is:

    includes/forms/file_editor.php
    

    Notice that it is file_editor.php with an underscore.

    I initially edited a similarly named file with a hyphen instead of the underscore, which caused some confusion because my changes were not being applied to the actual form.

    If you're not sure which file ProjectSend is loading, check the files-edit.php file. In my installation it loads the editor using:

    include_once FORMS_DIR . DS . 'file_editor.php';

    Result

    After making these changes I tested:

    • Manage Files
    • Edit File
    • View as Client
    • Logging in directly through the client portal
    • Large JPG images
    • PDFs
    • File downloads

    Everything is working normally now.

    The only functionality I intentionally gave up is automatic image thumbnails and the image dimension display. I don't need either of those for my use case.

    The original images are still stored normally and clients can download them without any problem.

    So at least in my case, the JPG files were not corrupted. The problem was triggered when ProjectSend tried to process large/high-resolution images to generate thumbnails and read their dimensions.

    I kept my PHP memory_limit at 128M and chose this approach instead of increasing it.

    Hopefully this helps someone else running into the same 500 error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.