Giter Site home page Giter Site logo

PDF files are not displayed about upload HOT 1 CLOSED

cedpar avatar cedpar commented on July 18, 2024
PDF files are not displayed

from upload.

Comments (1)

clarkwinkelmann avatar clarkwinkelmann commented on July 18, 2024

the upl-image-preview is only designed to preview files that are natively stored as images. In practice it should allow previewing any file that a browser can render inside of an <img src=""> tag. I suppose Safari somehow implemented PDF as a valid IMG source when all other browsers have not.

I am not finding any official documentation on why Safari choose to implement this and how it's supposed to work. The only relevant result seems to be this StackOverflow question but it doesn't lead to any useful information https://stackoverflow.com/questions/70193677/chrome-does-not-allow-me-to-use-pdf-in-img-tag In any case I doubt any browser is actively working to implement such a feature. I don't believe it's part of any web standard existing or in development.

FoF Upload does not have any native way to preview PDFs. Another extension could provide a new template that does. An easy solution would be to render the PDF in an iframe as it would take advantage of the browser ability to render a PDF viewer, but this would be dangerous to safeguard against XSS vectors. A safer solution would be an extension that implements a server-side rendering of a preview image and returns it to the frontend in a new template. I doubt either of these options would be added to FoF Upload directly at this moment as they require significant work and increase the maintenance burden.

If you still believe this is a bug with an existing FoF Upload feature, feel free to re-open the issue with more details.

from upload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.