Cannot View uploaded pdf's

Hi,

This issue is being discussed here:

Hi,

I strongly believe that the view button has to come back, I would like to make the decision myself to download the document or not. For instance I might be working from a remote location on a machine (which I often do) that is unsecured or not under my control for which I do not have rights to download or want to save a file locally outside of my secure session… Anyhow it opens up a security issue where you might leave files in a cache somewhere that could have sensitive information on it, this is not ideal.

So I would like to respectfully ask if this feature could be put back again.

Kind Regards

George V

Furthermore when I try to download the document it’s size is 0 Bytes…
see below


So I cannot see it anyway

Do not know where to go to from here

Pls advise

@david do you have any suggestions?

Is there any information in the browser console when you download

Hmm… this is interesting it seems to go and look for the file in my default downloads folder…

file:///D:/Downloads/SalesOrd6257755%20EwayTX%20%23691668182-3.pdf

Not on the InvoiceNinja machine where I attached it to the transaction record…

hmmm …

Now here is question for you, when you attach a file to a a record, in this case it is “Expense 220623-026”

Where does INV-Ninj store that record? . From what I understand it should be on the machine that is running the application in the mysql db … true ?

see below: I just clicked on the "“Upload File” radio button… Then it asked me to navigate to the file I want o upload, then I choose the file it says file uploaded and it appears as an attached document in the record … … where does it store that file ?

Now when I try do download the file I stored it goes and looks for it in the local downloads folder … and it downloads an empty file …

I’m not sure if there is a technical reason why you had to change it … but it was working fine before … so why the change ?

A little bit worried right now… We are going through the financial year end here in Australia and we are cross referencing orders & invoices etc … and there is no easy way to just display or reference a document attached to record … it has to be downloaded and then that record is empty … If it is an external auditor that does not know where to find the original then they are stuck…

regards
George V

Hi,

Any progress on the empty downloaded empty documents issue?

Regards

George V

Hi,

I updated to version v5.6.5-C121, I still can’t download or see attached documents. I was wondering if this issue being worked on? Is there any additional information or tests that I can provide to help?

Don’t know if it helps but the following error pop into the laravel log…

[2023-07-02 08:05:28] production.ERROR: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:0A000086:SSL routines::certificate verify failed {“userId”:2,“exception”:"[object] (ErrorException(code: 0): file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:0A000086:SSL routines::certificate verify failed at /var/www/invoiceninja/app/Http/Controllers/DocumentController.php:124)
[stacktrace]
#0 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(266): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#2 /var/www/invoiceninja/app/Http/Controllers/DocumentController.php(124): file_get_contents()
#3 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(145): App\Http\Controllers\DocumentController->App\Http\Controllers\{closure}()
#4 /var/www/invoiceninja/vendor/symfony/http-foundation/StreamedResponse.php(92): Illuminate\Routing\ResponseFactory->Illuminate\Routing\{closure}()
#5 /var/www/invoiceninja/vendor/symfony/http-foundation/Response.php(377): Symfony\Component\HttpFoundation\StreamedResponse->sendContent()
#6 /var/www/invoiceninja/public/index.php(61): Symfony\Component\HttpFoundation\Response->send()
#7 {main}
"}

It has never happened before … I’m using a self signed cert on my local network … why is it failing now ?

regards

GV

I’m not aware of anyone else seeing this problem which makes me think it could be a configuration issue. I’m not sure why the problem would start after an upgrade.

@david do you have any suggestions?

I think that message explains your situation.

There is an issue with the SSL.

Hi,

I read here View Button - Documents, GONE - #4 by hillel that something in the “header” was changed to accommodate something in the new release, not sure what changed but that is when I started having this issue … If I roll back to the release prior to that then I do not have this issue… However when I roll back I loose all the data that has been entered after… So rolling back is not really an option for me…

It seems that I’m not the only one with this issue … see this post by Frank …

Regards

GV

Hi,

Any ideas on how to fix the issue? Any ideas why the issue only appeared after update to v5.6.2 and I think this is what broke it …

Does this means that anyone who uses a self signed cert cannot view their or download their documents?

Regards

George

In the latest release we’ve added an option to view uploaded images in the app without needing to download them.

Hi,

Thanks for the quick response … I’ll try it on my dev system and get back to you …

George

Hi Hillel,

Just updated to v5.6.17-C123 and it seems that there is no option to view

Is there a later release ?

regards

George V

The view option is currently only for images, we’ll look into also supporting PDFs.

Hi Hillel,

If I try to drag and drop the document as an image I get this error

If I try to upload the document as an image I get this error

Seems to be the same error just different temporary filenames…

Any ideas?

Regards

George V

Are there any related errors in storage/logs?

yes there are …not very helpful

[2023-07-13 06:20:01] production.INFO: Performing Autobilling 2023-07-13 06:20:01

There was something when I tried to save the PDF …

“}
[2023-07-12 22:23:49] production.ERROR: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:0A000086:SSL routines::certificate verify failed {“userId”:2,“exception”:”[object] (ErrorException(code: 0): file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:0A000086:SSL routines::certificate verify failed at /var/www/invoiceninja/app/Http/Controllers/DocumentController.php:124)
[stacktrace]
#0 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(270): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#2 /var/www/invoiceninja/app/Http/Controllers/DocumentController.php(124): file_get_contents()
#3 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(145): App\Http\Controllers\DocumentController->App\Http\Controllers\{closure}()
#4 /var/www/invoiceninja/vendor/symfony/http-foundation/StreamedResponse.php(97): Illuminate\Routing\ResponseFactory->Illuminate\Routing\{closure}()
#5 /var/www/invoiceninja/vendor/symfony/http-foundation/Response.php(423): Symfony\Component\HttpFoundation\StreamedResponse->sendContent()
#6 /var/www/invoiceninja/public/index.php(61): Symfony\Component\HttpFoundation\Response->send()
#7 {main}
"}

It seems to be moaning about some ssl cert issue … I’m using self signed certs and I have been from the beginning … and I have always been able to view pdf’s up until V5.6.1 … when there was changes to Auth Method … at that point it failed … hoping you can fix that it so that I can use this very important feature (to me at least :slight_smile: )

kind regards

George V

Maybe the info here will help:

Note: in the next version we’ve added an option to view PDFs in the app.