mikebronner / nova-file-upload-field

The easiest drag-and-drop file uploading field for Laravel Nova.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Detail view not displaying correctly for pdf file

warksit opened this issue · comments

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):

  • Laravel Version: [ex: 8.62]
  • Browser and Version: [ex: Firefox 94.0.1]
  • Nova File Upload Field Package Version: [ex: 0.4.0]

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(),

@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.

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

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