BUG (?) - No attachments - Not Found - Invoice Web Guest View

Update from 1.5.4 to 1.5.5.

I upload some files (PDF, JGP) to the invoice in Version: 1.5.4

Guest-URL domain.tld/guest/view/invoice/cO8L4fQiYsdAwh7
FileName …/guest/get/attachment/cO8L4fQiYsdAwh7_Vertrag1.jpg

Error-Text:
Not Found
The requested URL /guest/get/attachment/cO8L4fQiYsdAwh7_Vertrag1.jpg was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

The Status from this invoice are open (read), waiting for billing.

in the /index.php/invoices/view/ all files okay to view or download. Only in the guest URL it doesn´t work.

DEBUG LOG

<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>

DEBUG - 2017-11-06 20:30:26 --> UTF-8 Support Enabled
DEBUG - 2017-11-06 20:30:26 --> Global POST, GET and COOKIE data sanitized
DEBUG - 2017-11-06 20:30:26 --> View MX_Controller Initialized
DEBUG - 2017-11-06 20:30:26 --> Config file loaded: /home/www/invoicefolder/application/config/invoice_plane.php
DEBUG - 2017-11-06 20:30:26 --> Encryption: Auto-configured driver ‘openssl’.
DEBUG - 2017-11-06 20:30:26 --> File loaded: /home/www/invoicefolder/application/modules/settings/models/Mdl_settings.php
DEBUG - 2017-11-06 20:30:26 --> File loaded: /home/www/invoicefolder/application/controllers/…/modules/layout/controllers/Layout.php
DEBUG - 2017-11-06 20:30:26 --> Layout MX_Controller Initialized
DEBUG - 2017-11-06 20:30:26 --> File loaded: /home/www/invoicefolder/application/modules/invoices/models/Mdl_invoices.php
DEBUG - 2017-11-06 20:30:26 --> File loaded: /home/www/invoicefolder/application/modules/invoices/models/Mdl_items.php
DEBUG - 2017-11-06 20:30:26 --> File loaded: /home/www/invoicefolder/application/modules/invoices/models/Mdl_invoice_tax_rates.php
DEBUG - 2017-11-06 20:30:26 --> File loaded: /home/www/invoicefolder/application/modules/payment_methods/models/Mdl_payment_methods.php
DEBUG - 2017-11-06 20:30:26 --> File loaded: /home/www/invoicefolder/application/modules/custom_fields/models/Mdl_custom_fields.php
DEBUG - 2017-11-06 20:30:26 --> File loaded: /home/www/invoicefolder/application/modules/custom_fields/models/Mdl_invoice_custom.php
DEBUG - 2017-11-06 20:30:26 --> File loaded: /home/www/invoicefolder/application/modules/custom_values/models/Mdl_custom_values.php
DEBUG - 2017-11-06 20:30:26 --> File loaded: /home/www/invoicefolder/application/modules/custom_fields/models/Mdl_client_custom.php
DEBUG - 2017-11-06 20:30:26 --> File loaded: /home/www/invoicefolder/application/modules/custom_fields/models/Mdl_user_custom.php
DEBUG - 2017-11-06 20:30:26 --> File loaded: /home/www/invoicefolder/application/modules/layout/views/alerts.php
DEBUG - 2017-11-06 20:30:26 --> File loaded: /home/www/invoicefolder/application/views/invoice_templates/public/Rechnung_Web.php
DEBUG - 2017-11-06 20:30:26 --> Total execution time: 0.0367
DEBUG - 2017-11-06 20:30:27 --> UTF-8 Support Enabled
DEBUG - 2017-11-06 20:30:27 --> Global POST, GET and COOKIE data sanitized
DEBUG - 2017-11-06 20:30:27 --> View MX_Controller Initialized
DEBUG - 2017-11-06 20:30:27 --> Config file loaded: /home/www/invoicefolder/application/config/invoice_plane.php
DEBUG - 2017-11-06 20:30:27 --> Encryption: Auto-configured driver ‘openssl’.
DEBUG - 2017-11-06 20:30:27 --> File loaded: /home/www/invoicefolder/application/modules/settings/models/Mdl_settings.php
DEBUG - 2017-11-06 20:30:27 --> File loaded: /home/www/invoicefolder/application/controllers/…/modules/layout/controllers/Layout.php
DEBUG - 2017-11-06 20:30:27 --> Layout MX_Controller Initialized
DEBUG - 2017-11-06 20:30:27 --> File loaded: /home/www/invoicefolder/application/modules/invoices/models/Mdl_invoices.php
DEBUG - 2017-11-06 20:30:27 --> File loaded: /home/www/invoicefolder/application/modules/invoices/models/Mdl_items.php
DEBUG - 2017-11-06 20:30:27 --> File loaded: /home/www/invoicefolder/application/modules/invoices/models/Mdl_invoice_tax_rates.php
DEBUG - 2017-11-06 20:30:27 --> File loaded: /home/www/invoicefolder/application/modules/payment_methods/models/Mdl_payment_methods.php
DEBUG - 2017-11-06 20:30:27 --> File loaded: /home/www/invoicefolder/application/modules/custom_fields/models/Mdl_custom_fields.php
DEBUG - 2017-11-06 20:30:27 --> File loaded: /home/www/invoicefolder/application/modules/custom_fields/models/Mdl_invoice_custom.php
DEBUG - 2017-11-06 20:30:27 --> File loaded: /home/www/invoicefolder/application/modules/custom_values/models/Mdl_custom_values.php
DEBUG - 2017-11-06 20:30:27 --> File loaded: /home/www/invoicefolder/application/modules/custom_fields/models/Mdl_client_custom.php
DEBUG - 2017-11-06 20:30:27 --> File loaded: /home/www/invoicefolder/application/modules/custom_fields/models/Mdl_user_custom.php
DEBUG - 2017-11-06 20:30:27 --> File loaded: /home/www/invoicefolder/application/modules/layout/views/alerts.php
DEBUG - 2017-11-06 20:30:27 --> File loaded: /home/www/invoicefolder/application/views/invoice_templates/public/Rechnung_Web.php
DEBUG - 2017-11-06 20:30:27 --> Total execution time: 0.2490

Any ideas ?

Hello,

Can you please test to add index.php/ before /guest

FileName …index.php/guest/get/attachment/cO8L4fQiYsdAwh7_Vertrag1.jpg

Hallo @Maxime_GRIMLER,

thanks for reply. Test is than okay. in which file from the Template must be edit?

Hello @Andree

Cool it works :slight_smile:
I have made a Pull Request which should be available at the next version but if you can’t wait it’s all in the public template

 application/views/invoice_templates/public/

Edit your template (or the default one if you use the default one) and replace at the end (line 275 if you use default one)

<a href="<?php echo base_url('/guest/get/attachment/' . $attachment['fullname']); ?>"

with

<a href="<?php echo site_url('guest/get/attachment/' . $attachment['fullname']); ?>"

(feel free to look at the changes in the PR

Regards,