johndatserakis / file-upload-with-preview

🖼 Simple file-upload utility that shows a preview of the uploaded image. Written in TypeScript. No dependencies. Works well with or without a framework.

Home Page:https://johndatserakis.github.io/file-upload-with-preview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PDF Upload Error Generated

opened this issue · comments

When trying to upload a PDF (as opposed to an image), an error is generated in the console:

Failed to load resource: the server responded with a status of 404 (Not Found)

The file does get captured correctly and will upload successfully, but this error is generated when selecting the PDF to upload.

In addition, I assume generating a thumbnail preview of the PDF is not going to work - is there a way we could use a predefined image for when people upload a PDF?

Hi there, sorry for the extremely late response.

There is a way to customize the PDF image shown, that is, to use the options.images.successPdfImage option.

To address the content of your message, I am seeing PDF's appear in the cachedFileArray properly as application/pdf types. Perhaps when your comment was made this component was in an older state. I believe now it is working.

I understand you may have moved on from this library, so I'll leave the thread open a bit longer then close it.