Quantcast
Viewing all articles
Browse latest Browse all 21

How do remove unwanted linefeed charachter from file-download in Laravel Nova?

In a Laravel Nova application i've got a strange issue: Whenever i try to download a file i have a linefeed char on the first line (0A, an empty line). This corrupts images, zip-files and so on. But what is causing this?

I've tried/checked:

  1. Check all php files on closing tags (there are none)
  2. Original file on hdd does not have this extra linefeed when it's created
  3. Checked every php file since last release for correct UTF-8 encoding
  4. Copied composer.lock from live server and installed everything again
  5. Ran composer dump, php artisan cache:clear, php artisan clear-compiled
  6. Checked all code changes since the last release (where there was no issue)
  7. Tried Chrome and Firefox

Here's some Laravel Nova code that produced this error:

return Fields\Image::make(__('Image')), 'imageStorage')        ->rules('image', "dimensions:max_width={$image_max_width},max_height={$image_max_height}")        ->squared()        ->disk(Enums\StorageDisk::APP_PUBLIC_DISTRIBUTORS)        ->path(DistributorPath::products($distributorId))        ->deletable(false)        ->prunable()        ->onlyOnForms(); 

First charachter is always 0A.

So, how do i find the cause? Any tips or strategy?


Viewing all articles
Browse latest Browse all 21

Trending Articles