1

I am trying to preview different file types, but Its not working. By default jQuery File upload only previews Image files(jpeg | png | gif). But I need to display a preview for Other File types such as (pdf | doc | pptx | txt). How to achive this?? I tried changing this, but no luck

Existing Code:

previewFileTypes: /^image\/(gif|jpeg|png)$/,

My Change: (Still does not show preview for pdf, doc, ppt)

previewFileTypes: /^.*\/(gif|jpeg|png|pdf|PDF|pptx|plain|doc|docx)$/,
Naveen Reddy
  • 153
  • 3
  • 9
  • 24

1 Answers1

1

The preview is for showing images. The PDF and document file types are not images, and cannot be shown. From the documentation:

Preview images, audio and video: A preview of image, audio and video files can be displayed before uploading with browsers supporting the required APIs.

Lucas Fowler
  • 189
  • 2
  • 12
  • Thanks for the reply, Is there anyway we could preview other file type?? – Naveen Reddy Aug 01 '13 at 19:46
  • Not without first uploading it to the server, and then creating an image thumbnail. The other document types don't have any sort of access to a thumbnail image, which is what the preview is. – Lucas Fowler Aug 01 '13 at 20:02