mikebronner / nova-file-upload-field

The easiest drag-and-drop file uploading field for Laravel Nova.
MIT License
53 stars 7 forks source link

Detail view not displaying correctly for pdf file #17

Open warksit opened 2 years ago

warksit commented 2 years ago

Describe the bug An uploaded pdf file displays on a resources detail page as "This image could not be found". "This image" is a link to the pdf file.

To Reproduce Steps to reproduce the behavior:

  1. Upload PDF file
  2. Viiew detail page of resource

Expected behavior Expected a download link similar the the standard Nova File Field

Screenshots Screenshot 2021-11-12 at 10 06 18

Desktop (please complete the following information):

I may be missing something!

The relevant fields section of the resource (standard Nova File Field just there for reference):

File::make('Nova File Field', 'file')->exceptOnForms(),

FileUpload::make("FileUpload Field", 'file')
    ->path("public")
    ->creationRules('required', 'mimes:pdf', 'max:5000')
    ->updateRules('sometimes', 'mimes:pdf', 'max:5000')
    ->hideFromIndex()
    ->prunable(),
mikebronner commented 2 years ago

@warksit Thanks for writing in. I believe this is because the file upload field does not extract thumbnails from PDFs. Only image files (likely bitmaps) would have thumbnails available.

mikebronner commented 2 years ago

Re-opening: I would be happy to consider a PR for this issue.

warksit commented 2 years ago

OK, thanks for the response. Let me look into the code and see what needs to be done