Attachments to Expenses

Hi

If we could attach images and eml files to expenses that would be great.

I’m not sure I understand, this is supported.

I’ve tried several times and it gives an error.

What error are you seeing?

It should allow images, we restrict file types though.

https://github.com/invoiceninja/invoiceninja/blob/master/app/Models/Document.php#L52

It just displays a cross over the image, allows me to save and then the attachment is simply not there when I saved.

Are there any errors when hovering over the cross or in the browser console?

Please also check storage/logs/laravel-error.log.

Here’s what I see:
http://prntscr.com/eu8720
http://prntscr.com/eu875z

And here’s what the log has to say:
[2017-04-09 08:04:52] production.ERROR: exception ‘Intervention\Image\Exception\MissingDependencyException’ with message ‘PHP Fileinfo extension must be installed/enabled to use Intervention Image.’ in /home/billingwhatnoweb/public_html/vendor/intervention/image/src/Intervention/Image/ImageManager.php:133 Stack trace: #0 /home/billingwhatnoweb/public_html/vendor/intervention/image/src/Intervention/Image/ImageManager.php(25): Intervention\Image\ImageManager->checkRequirements() #1 /home/billingwhatnoweb/public_html/app/Ninja/Repositories/DocumentRepository.php(130): Intervention\Image\ImageManager->__construct(Array) #2 /home/billingwhatnoweb/public_html/app/Http/Controllers/DocumentController.php(100): App\Ninja\Repositories\DocumentRepository->upload(Array, NULL) #3 [internal function]: App\Http\Controllers\DocumentController->postUpload(Object(App\Http\Requests\CreateDocumentRequest)) #4 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(9482): call_user_func_array(Array, Array) #5 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(9544): Illuminate\Routing\Controller->callAction(‘postUpload’, Array) #6 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(9524): Illuminate\Routing\ControllerDispatcher->call(Object(App\Http\Controllers\DocumentController), Object(Illuminate\Routing\Route), ‘postUpload’) #7 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #8 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #9 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #10 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10006): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #11 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(9525): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #12 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(9512): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(App\Http\Controllers\DocumentController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), ‘postUpload’) #13 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(8582): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), ‘App\Http\Contro…’, ‘postUpload’) #14 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(8569): Illuminate\Routing\Route->runController(Object(Illuminate\Http\Request)) #15 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(8283): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request)) #16 [internal function]: Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #17 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #18 /home/billingwhatnoweb/public_html/app/Http/Middleware/Authenticate.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #19 [internal function]: App\Http\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure), ‘user’) #20 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #21 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #22 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #23 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #24 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10006): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #25 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(8284): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #26 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(8275): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request)) #27 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(8265): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request)) #28 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(2419): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #29 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request)) #30 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #31 /home/billingwhatnoweb/public_html/vendor/barryvdh/laravel-cors/src/HandlePreflight.php(38): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #32 [internal function]: Barryvdh\Cors\HandlePreflight->handle(Object(Illuminate\Http\Request), Object(Closure)) #33 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #34 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #35 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #36 /home/billingwhatnoweb/public_html/app/Http/Middleware/StartupCheck.php(201): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #37 [internal function]: App\Http\Middleware\StartupCheck->handle(Object(Illuminate\Http\Request), Object(Closure)) #38 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #39 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #40 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #41 /home/billingwhatnoweb/public_html/app/Http/Middleware/QueryLogging.php(32): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #42 [internal function]: App\Http\Middleware\QueryLogging->handle(Object(Illuminate\Http\Request), Object(Closure)) #43 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #44 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #45 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #46 /home/billingwhatnoweb/public_html/app/Http/Middleware/DuplicateSubmissionCheck.php(22): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #47 [internal function]: App\Http\Middleware\DuplicateSubmissionCheck->handle(Object(Illuminate\Http\Request), Object(Closure)) #48 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #49 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #50 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #51 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(3225): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #52 /home/billingwhatnoweb/public_html/app/Http/Middleware/VerifyCsrfToken.php(44): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure)) #53 [internal function]: App\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure)) #54 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #55 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #56 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #57 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(13532): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #58 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #59 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #60 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #61 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #62 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(12022): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #63 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #64 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #65 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #66 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #67 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(13271): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #68 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure)) #69 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #70 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #71 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #72 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(13208): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #73 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure)) #74 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #75 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #76 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #77 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(3286): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #78 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure)) #79 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #80 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #81 /home/billingwhatnoweb/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #82 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #83 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(10006): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #84 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(2366): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #85 /home/billingwhatnoweb/public_html/bootstrap/cache/compiled.php(2350): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #86 /home/billingwhatnoweb/public_html/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #87 {main} [] []

“PHP Fileinfo extension must be installed/enabled to use Intervention Image.”

It looks like you need to install/enable Fileinfo

Strange. I’m running PHP 7.0 on that account but no Fileinfo installed. Got it installed through WHM EasyApache though but still the same error.

I’ll reboot the entire server and report back although I’d prefer to not have to do that.

Still the same unfortunately.

Installed Fileinfo, rebooted the server, logged out and back in to the billing platform.

Not sure… maybe create a phpinfo() page to check.

Mmmm… This is interesting…

I enabled PHP 7 through WHM’s MultiPHP Manager but when I threw up an info.php file and added the phpinfo() call it showed I was running PHP 5.

I then manually pushed it up to PHP 7.0.17 as I know I installed fileinfo.

So, that done I checked php info again:
http://prntscr.com/eu8g81

All good, but still unable to upload a JPG file.

Have you confirmed it’s the same error in the logs.

This is odd.

[2017-04-09 09:18:02] production.ERROR: exception ‘Intervention\Image\Exception\MissingDependencyException’ with message ‘PHP Fileinfo extension must be installed/enabled to use Intervention Image.’ in /home/billingwhatnoweb/public_html/vendor/intervention/image/src/Intervention/Image/ImageManager.php:133

There’s more of-course but I know the extension is installed.

Strange…

Yes. Happy to try out other stuff but it’s odd that’s for sure. Could I be missing something…? Perhaps Invoice Ninja can set the version of PHP to use itself somewhere…?

Sorry, I’m not sure.