Problem with upload in invoice

FYI - It appears the Dec 15th update breaks the functionality.

If I roll back to the Dec 8th 2024 update it works correctly.

2 Likes

What is the extension of the file that you want to upload?

My attachments are always PDF documents.

Take a look here:

$tempFile = $_FILES['file']['tmp_name'];
        $filePath = $this->get_target_file_path($url_key, $fileName);

        if (!$this->validate_upload($tempFile, $fileName)) {
            return;
        }

        $fileType = mime_content_type($tempFile);
        if (!$this->validate_mime_type($fileType)) {
            return;
        }

All that return gives you absolutely nothing in the log file.

Maybe $tempFile = $_FILES['file']['tmp_name']; is empty or has a weird extension.
Then validate_mime_type fails and exactly nothing gets logged.

If we can’t figure it out before 1.6.3 goes beta, we’ll fall back to the December 8th version of the file.

Hi there, appreciate the project!
Same issue here, after Dec 15th the function Upload.php breaks, and the changes mentioned earlier in this thread don’t solve it.
Just putting the version from December 8th in place does work.
So using this as a workaround for now.

1 Like

The same issue. With 1.6.1 it works.

The `December 8th version’ is probably the same version as 1.6.1

If you want and if you can make it work you can put back that 1.6.1 version or December 8 version.

If you want to make a pull-request for it, that’s appreciated.

It’s probably reverting this PR: Chore: Fix upload_file function by nielsdrost7 Ā· Pull Request #1141 Ā· InvoicePlane/InvoicePlane Ā· GitHub

So any PR is appreciated or otherwise: fix it temporarily and wait for the 1.6.3 version