从asp.net中的文件夹下载Pdf文件 [英] Download Pdf file from folder in asp.net

查看:79
本文介绍了从asp.net中的文件夹下载Pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过在asp.net中使用文件夹浏览器对话框上传了一个pdf文件现在我用魔杖下载保存在asp.net文件夹中的pdf文件,但它显示我的错误,但同时.docx文件轻松下载

解决方案



你在代码中为PDF添加了MISE类型吗?


你可以拥有看看下面的链接,它通常描述了如何从文件夹点击按钮下载文件。



在按钮上下载文件点击



此外,您可以根据您的要求更改内容类型,以使此代码适用于不同的文件类型。



进一步的内容/ MIME类型列表。 />


您可以查看此链接。



列表内容类型





如果我们谈谈这一点。



您必须将内容类型更改为

 application / pdf 

以进行PDF下载。



Hoe我会帮你的。 :)


I am uploaded a pdf file by using folder browser dialog in asp.net now i wand to download that pdf file saved in folder in asp.net but its showing me error but at same time .docx file easily downloaded

解决方案

hi,
have you added MISE type for PDF in your code??


You can have a look at the following link which generally describes that how to download a file on a button click from a folder.

Download a file on Button Click

Further you can change the content Type as per you requirement to make this code work for different file types.

Further for the list of Content/MIME Types.

You can have a look at this link.

List of Content Types.


and if we talk to the point.

You have to change the content type to

application/pdf

for PDF download.

Hoe it will help. :)


这篇关于从asp.net中的文件夹下载Pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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