asp页面返回jpg图像的问题... [英] Problem with asp page returning a jpg image...

查看:52
本文介绍了asp页面返回jpg图像的问题...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面show_image.asp的问题,它返回一个jpg图像在

Windows XP专业版SP2下。该页面将内容类型设置为:


Response.ContentType =" image / jpg"

虽然这在大多数机器上运行得非常好,在某些机器上我

遇到这个问题:


加载页面时弹出一个窗口,询问我是否要打开

文件show_page.asp。当我点击打开时Interdev弹出并打开一个名为show_image.asp的窗口,但该页面的内容顶部有几个html

标签,后跟二进制jpg数据。事实上,如果我删除

html标签并将页面保存为something.jpg然后查看它,它会显示

预期的图像。


之前我注意到了这个问题,并且在一些禁用的机器上发现了这个问题。在IIS管理员中虚拟目录的服务器端调试就是这样的。

在其他情况下,我重新创建了服务器扩展并解决了它。我没有完全理解为什么会发生这种情况以及可靠的

修复方法。


有什么想法吗?

I have a problem with a page show_image.asp that returns a jpg image under
Windows XP Pro SP2. The page sets content type as:

Response.ContentType = "image/jpg"

While this works perfectly fine on most machines, on some machines I
experience this problem:

When loading the page a window pops up that asks if I want to open the
document show_page.asp. When I click "Open" Interdev pops up and opens up a
window titled show_image.asp but the contents of that page has a few html
tags at the top followed by the binary jpg data. In fact, if I delete the
html tags and save the page as something.jpg and then look at it, it shows
the expected image.

I''ve noticed this problem before and found on some machines that disabling
server side debugging for the virtual directory in IIS admin does the trick.
On other occasions, I recreated the server extensions and that solved it. I
have never completely managed to understand why this happens and a reliable
way to fix it.

Any ideas?

推荐答案



Peter写道:

Peter wrote:

我有一个页面show_image.asp在

Windows XP专业版SP2下返回jpg图像的问题。该页面将内容类型设置为:


Response.ContentType =" image / jpg"

虽然这在大多数机器上运行得非常好,在某些机器上我

遇到这个问题:


加载页面时弹出一个窗口,询问我是否要打开

文件show_page.asp。当我点击打开时Interdev弹出并打开一个名为show_image.asp的窗口,但该页面的内容顶部有几个html

标签,后跟二进制jpg数据。
I have a problem with a page show_image.asp that returns a jpg image under
Windows XP Pro SP2. The page sets content type as:

Response.ContentType = "image/jpg"

While this works perfectly fine on most machines, on some machines I
experience this problem:

When loading the page a window pops up that asks if I want to open the
document show_page.asp. When I click "Open" Interdev pops up and opens up a
window titled show_image.asp but the contents of that page has a few html
tags at the top followed by the binary jpg data.



为什么不向我们展示show_page.asp?

Why not show us "show_page.asp"??


好的,这里它是:


test.asp

--------

< html>

< head>

< meta http-equiv =" Content-Type" content =" text / html">

< title>测试仓库布局< / title>

< / head>

< body>

< img src =" show_image.asp">

< / body>

< / html> ;

show_image.asp:

---------------

<%@ Language = VBScript%>

<%

选项明确


Response.Expires = -1

Response.Buffer = True

Response.ContentType =" image / jpg"


Dim objWarehouse


设置objWarehouse = mlobjAPP3Database.Warehouse()


如果不是objWarehouse则没有那么

Response.BinaryWrite objWarehouse.LayoutJPG()

结束如果

%>


请不要忘记这适用于大多数机器。但是,我经常在开发机器上遇到麻烦,并且想知道它是否有事可做。

,为IIS启用了服务器/客户端调试,或者它是否具有

与frontpage或interdev IIS扩展有关。


Pete


" Larry Bud" < la ********** @ yahoo.comwrote in message

news:11 ******************** **@c28g2000cwb.googlegr oups.com ...
OK, here it goes:

test.asp
--------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<title>Test Warehouse layout</title>
</head>
<body>
<img src="show_image.asp">
</body>
</html>
show_image.asp:
---------------
<%@ Language=VBScript %>
<%
Option Explicit

Response.Expires = -1
Response.Buffer = True
Response.ContentType = "image/jpg"

Dim objWarehouse

Set objWarehouse = mlobjAPP3Database.Warehouse()

If Not objWarehouse Is Nothing Then
Response.BinaryWrite objWarehouse.LayoutJPG()
End If
%>

Please don''t forget that this works on most machines. However, I frequently
have troubles on development machines and wonder if it has something to do
with server/client side debugging being enabled for IIS or if it has
something to do with frontpage or interdev IIS extensions.

Pete

"Larry Bud" <la**********@yahoo.comwrote in message
news:11**********************@c28g2000cwb.googlegr oups.com...

>

Peter写道:
>
Peter wrote:

>我有一个页面show_image.asp的问题,它返回一个jpg图像
Windows XP Pro SP2。该页面将内容类型设置为:

Response.ContentType =" image / jpg"

虽然这在大多数机器上完全正常,但在某些机器上我会这样做
遇到这个问题:

加载页面时弹出一个窗口,询问我是否要打开
文档show_image.asp。当我点击打开时Interdev弹出并打开一个名为show_image.asp的窗口,但该页面的内容顶部有几个html
标签,后跟二进制jpg数据。
>I have a problem with a page show_image.asp that returns a jpg image
under
Windows XP Pro SP2. The page sets content type as:

Response.ContentType = "image/jpg"

While this works perfectly fine on most machines, on some machines I
experience this problem:

When loading the page a window pops up that asks if I want to open the
document show_image.asp. When I click "Open" Interdev pops up and opens
up a
window titled show_image.asp but the contents of that page has a few html
tags at the top followed by the binary jpg data.



为什么不向我们展示show_image.asp??


Why not show us "show_image.asp"??



Peter写道:
Peter wrote:

Response.ContentType =" image / jpg"
Response.ContentType = "image/jpg"



如果您查看浏览器在上传jpg

文件时发送的内容类型,您会发现它是 ; image / jpeg",not notimage / jpg。此外,

IIS 6发送image / jpeg在.jpg请求的内容类型标头中。尝试

将您的代码更改为公认的内容类型。


-

戴夫安德森


未经请求的商业电子邮件将以

If you look at the content-type sent by the browser when you UPLOAD a jpg
file, you will find that it is "image/jpeg", not "image/jpg". Furthermore,
IIS 6 sends "image/jpeg" in the content-type header for .jpg requests. Try
changing your code to a recognized content type.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of


这篇关于asp页面返回jpg图像的问题...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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