可以在浏览器中查看哪些文件类型(内联,无插件) [英] Which file types can be viewed in browser (inline, without a plugin)

查看:509
本文介绍了可以在浏览器中查看哪些文件类型(内联,无插件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想知道可以在浏览器(例如Chrome,Firefox)中查看哪些文件类型(例如.png,.pdf,.txt)。因为有时当我单击文件链接时,它会自动下载,而不是在浏览器中显示。为什么会这样?下面是我的代码。

I just want to know which file types (like .png, .pdf, .txt) can be viewed in browser (like Chrome, Firefox). Because sometimes when i click on file link, instead of displaying in browser it download automatically. Why this happens ? Below is my code. Any help will be appreciated.

<script>

function openPDF(url){
   var w=window.open(url, '_blank');
   w.focus();
}

</script>
<a href="burger1.jpg" target='_blank'>link</a>
<div onclick="openPDF('1.pdf');">PDF 1</div>


推荐答案

在正常情况下,可以在浏览器中查看以下文件。

In normal cases, following files can be viewed in browser.

.PNG
.JPEG
.PDF
.doc
等...

.PNG .JPEG .PDF .doc etc ...

和以下文件将始终被下载。

and following files will always be download.

.zip
.exe
等...

.zip .exe etc ...

但是在特殊情况下,这取决于用户浏览器的设置和首选项。您可以从链接。

But in special cases, it depends on user browser settings and preference. You can get further details from this link.

这篇关于可以在浏览器中查看哪些文件类型(内联,无插件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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