在上传到服务器之前预览.doc / .docx / .pdf文件 [英] Preview .doc/.docx/.pdf files before uploading to server

查看:173
本文介绍了在上传到服务器之前预览.doc / .docx / .pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用HTML5 File API来上传一些文档(.doc / .docx / .pdf)。我想在将文档上传到服务器之前显示该文档预览。有没有办法在客户端做这样的事情?

I'm using HTML5 File API to get some document(.doc/.docx/.pdf) uploaded. And I want to show that document preview before uploading it to server. Is there any way to do such thing on client side?

P.S。 Google文档查看器不正常,因为它需要可以从互联网访问文档。

P.S. Google Docs Viewer isn't ok, because it requires document to be accessible from the internet.

推荐答案

不。这是不可能的。

您希望浏览器查看不应该的数据文件。您有Office或PDF查看器(确定,已授予,PDF ssems现在位于浏览器内...)以查看您的数据文件。

You want the browser to view a datafile it shouldn't. You have Office or PDF viewers (OK, granted, PDF ssems to be inside browsers now...) to view your data files.

如果要在浏览器中显示预览,则必须先将其上传并将其存储在for-preview目录中。确定后,将其移至最终目的地,否则,删除。

If you want to show a preview in the browser, you have to upload it first and store it in a "for-preview" dir or something. When OK, move it to its final destination, otherwise, delete.

这篇关于在上传到服务器之前预览.doc / .docx / .pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆