图像不显示 [英] Images Not Displaying

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

问题描述

大家好,


response.write FilePath给出了这条路径,ImageName.jpeg但是图片

没有显示在下面的代码。我错过了什么..?干杯。


<%Response.Write FilePath%>

原始图片:< BR>

< IMG SRC ="<%= Server.MapPath(" ImageUploads \)& FilePath%>">< P>


缩略图(减少50%):< BR>

< IMG SRC =" <%= Server.MapPath(" ImageUploads\Thumbs\Thumb")& FilePath%>">


文件肯定存在于数据库中。


Mark Sargent。

解决方案

抱歉,应该在硬盘上阅读,而不是在数据库中...干杯......


查看生成页面的来源,看看输出结果是什么。

可能是你在imageuploads之前缺少\,但是没有来源

它'很难说。也取决于Filepath的价值。


Stu


" Mark Sargent" <做********* @ hotmail.com>在消息中写道

新闻:#R ************** @ tk2msftngp13.phx.gbl ...

大家好,<响应.write FilePath给出了这个路径,ImageName.jpeg但是图像没有显示在下面的代码中。我错过了什么..?干杯。

<%Response.Write FilePath%>
原始图片:< BR>
< IMG SRC ="<%= Server.MapPath( ImageUploads \)& FilePath%>">< P>

缩略图(减少50%):< BR>
< IMG SRC ="<%= Server.MapPath( ImageUploads\Thumbs\Thumb)& FilePath%>">

文件肯定存在于数据库中。

Mark Sargent。



我最近在转换部分网站时发现了这个问题,发现

的原因是在Server.MapPath代码中


我把它作为./(以前它们的主要页面是

与图像相同的文件夹)并且我在
root,我不得不将其更改为../path/sub-folder。我可能是错的

但是,似乎Server.MapPath无法解释通常在图像标签等中使用的子文件夹

路径。(至少,因为问题我

经验丰富,我发现解决它的唯一方法.....给我那个

印象)。


-

问候


Steven Burn

Ur IT Mate Group首席执行官
www.it-mate.co.uk


免责声明:

我知道我可能错了,我只是喜欢参加:o)

Mark Sargent< ;做********* @ hotmail.com>在消息中写道

新闻:#R ************** @ tk2msftngp13.phx.gbl ...

大家好,<响应.write FilePath给出了这个路径,ImageName.jpeg但是图像没有显示在下面的代码中。我错过了什么..?干杯。

<%Response.Write FilePath%>
原始图片:< BR>
< IMG SRC ="<%= Server.MapPath( ImageUploads \)& FilePath%>">< P>

缩略图(减少50%):< BR>
< IMG SRC ="<%= Server.MapPath( ImageUploads\Thumbs\Thumb)& FilePath%>">

文件肯定存在于数据库中。

Mark Sargent。



Hi All,

response.write FilePath gives this path, ImageName.jpeg but the image(s)
doesn''t display in the below code. What am I missing..? Cheers.

<%Response.Write FilePath%>
Original Image:<BR>
<IMG SRC="<%=Server.MapPath("ImageUploads\") & FilePath%>"><P>

Thumbnail (50% reduction):<BR>
<IMG SRC="<%=Server.MapPath("ImageUploads\Thumbs\Thumb" ) & FilePath%>">

The files definitely exist in the database.

Mark Sargent.

解决方案

sorry, that should read, on the harddrive, not in the database...cheers...


View source of the page generated and see what the output is coming out as.
It may be you are missing the \ before imageuploads, but without the source
it''s difficult to say. Depends also the value of Filepath as well.

Stu

"Mark Sargent" <do*********@hotmail.com> wrote in message
news:#R**************@tk2msftngp13.phx.gbl...

Hi All,

response.write FilePath gives this path, ImageName.jpeg but the image(s)
doesn''t display in the below code. What am I missing..? Cheers.

<%Response.Write FilePath%>
Original Image:<BR>
<IMG SRC="<%=Server.MapPath("ImageUploads\") & FilePath%>"><P>

Thumbnail (50% reduction):<BR>
<IMG SRC="<%=Server.MapPath("ImageUploads\Thumbs\Thumb" ) & FilePath%>">

The files definitely exist in the database.

Mark Sargent.



I recently had this problem when converting part of my site and found the
cause to be in the Server.MapPath code

I had it as ./ (which it was previously as the main pages for them were in
the same folder as the images) and as I had the new pages in a sub-folder of
the root, I had to change it to ../path/sub-folder instead. I could be wrong
but, it would seem that Server.MapPath is unable to interpret sub-folder
paths normally used in image tags etc. (atleast, because of the problem I
experienced and the only way I found to solve it..... gives me that
impression).

--
Regards

Steven Burn
Ur I.T. Mate Group CEO
www.it-mate.co.uk

Disclaimer:
I know I''m probably wrong, I just like taking part :o)
Mark Sargent <do*********@hotmail.com> wrote in message
news:#R**************@tk2msftngp13.phx.gbl...

Hi All,

response.write FilePath gives this path, ImageName.jpeg but the image(s)
doesn''t display in the below code. What am I missing..? Cheers.

<%Response.Write FilePath%>
Original Image:<BR>
<IMG SRC="<%=Server.MapPath("ImageUploads\") & FilePath%>"><P>

Thumbnail (50% reduction):<BR>
<IMG SRC="<%=Server.MapPath("ImageUploads\Thumbs\Thumb" ) & FilePath%>">

The files definitely exist in the database.

Mark Sargent.



这篇关于图像不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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