Comments (1)
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)
- AWS S3 Error: Undefined constant GuzzleHttp\ClientInterface::VERSION in /flarum/app/vendor/aws/aws-sdk-php/src/functions.php:265 HOT 1
- 500 错误 HOT 7
- Cleanup for imgur uploads does not work
- Check MIME type & file size before upload
- `--cleanup` can not cleanup the file correctly
- Show 500 error when user uploads a file size larger than limited file size in backend HOT 2
- Request: ENV variables
- Remove file on 3s storage when deleting a file in manage uploaded files HOT 2
- Request: test s3 upload in admin
- Copy paste images HOT 1
- Cleanup CLI command logic deletes all files using "Default File Download Template" HOT 2
- Upload your watermark image is not work HOT 3
- Enable watermark images, uploader is not placed the processed image to the editor's content HOT 3
- Members cannot delete their own files HOT 2
- No hint path defined for [another-extension-i-added] HOT 3
- Load More Files does not work as expected
- Can't install on PHP 8.2 HOT 2
- Feature Request: File Download Template without proxy download and instead using CDN URL
- Installation error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from upload.