下载文件时出现“System.PlatformNotSupportedException”类型的异常。 [英] Exception of type 'System.PlatformNotSupportedException' while downloading file.

查看:243
本文介绍了下载文件时出现“System.PlatformNotSupportedException”类型的异常。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有



我正在为下载图像文件编写代码。

Dear All

I am writing code for download image file.

Response.AppendHeader();
Response.ContentType=type;
Respone.WriteFile(file);
Response.End();



这适用于.gif,.jpeg,.png,但它给'tiff'带来了问题。我已经尝试了ContentTypeimage / tif&image / tiff但它给出了错误标题


This is working for .gif,.jpeg,.png but it is giving problem for 'tiff'. I have try ContentType "image/tif" &"image/tiff" but it is giving error Headers

'Page.Response.Headers' threw an exception of type System.PlatformNotSupportedException'	System.Collections.Specialized.NameValueCollection {System.PlatformNotSupportedException}.



我也尝试将应用程序池更改为已集成,但仍无法正常工作。

我正在使用Classic 2.0 app pool& iis 7.0。

我有临时解决方案。 当我删除更新面板时,它工作正常。

你能告诉我为什么会这样吗?



谢谢


I have also tried for changing app pool to integrated but still it is not working.
I am using Classic 2.0 app pool & iis 7.0.
I have got temporary solution. As I remove update panel it works fine.
Can u tell me why this is happening?

Thanks

推荐答案

看看这个:



http://forums.iis.net/t/1150672.aspx [ ^ ]


Solution1。

无需删除更新面板,只需要适用于该控件的PostBackTrigger。

解决方案2.

将应用程序池从经典更改为集成。
Solution1.
No need to remove update panel only you will have to apply as PostBackTrigger for that control.
Solution2.
change application pool as from classic to integrated.


这篇关于下载文件时出现“System.PlatformNotSupportedException”类型的异常。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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