473,568 Members | 2,964 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Images Not Displaying

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.Writ e FilePath%>
Original Image:<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\") & FilePath%>"><P>

Thumbnail (50% reduction):<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\Thumbs\T humb") & FilePath%>">

The files definitely exist in the database.

Mark Sargent.
Jul 19 '05 #1
24 4665
sorry, that should read, on the harddrive, not in the database...chee rs...
Jul 19 '05 #2
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*********@ho tmail.com> wrote in message
news:#R******** ******@tk2msftn gp13.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.Writ e FilePath%>
Original Image:<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\") & FilePath%>"><P>

Thumbnail (50% reduction):<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\Thumbs\T humb") & FilePath%>">

The files definitely exist in the database.

Mark Sargent.

Jul 19 '05 #3
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*********@ho tmail.com> wrote in message
news:#R******** ******@tk2msftn gp13.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.Writ e FilePath%>
Original Image:<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\") & FilePath%>"><P>

Thumbnail (50% reduction):<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\Thumbs\T humb") & FilePath%>">

The files definitely exist in the database.

Mark Sargent.

Jul 19 '05 #4
Hi All,

k, the images are found via this path,
rootfolder\Clas sifieds\ImageUp loads\ImageName .jpeg..FilePath =
ImageName.jpeg without a preceeding \. Would only need a preceeding ../ if
the start folder was one folder above....still stumped. Cheers.

Mark Sargent.
Jul 19 '05 #5
full code below...cheers. ..

<HTML>
<HEAD>
<TITLE>AspJpe g - Simple.asp</TITLE>
</HEAD>
<BODY>
<%
Dim FilePath
if Request.QuerySt ring("FilePath" ) <> "" then
FilePath = Request.QuerySt ring("FilePath" )
End If
Response.Write FilePath
%>
<%
' Create instance of AspJpeg
Set Jpeg = Server.CreateOb ject("Persits.J peg")

' Compute path to source image
Path = Server.MapPath( FilePath)

' Open source image
Jpeg.Open Path

' Decrease image size by %
Jpeg.Width = Jpeg.OriginalWi dth / 1.1
Jpeg.Height = Jpeg.OriginalHe ight / 1.1

' Apply sharpening if necessary
' Jpeg.Sharpen 1, 130

' create thumbnail and save it to disk
FilePath = Replace(FilePat h, "/", "\")
FilePath = Replace(FilePat h, "ImageUploads\" , "")
Jpeg.Save Server.MapPath( "ImageUploads\T humbs") & "\Thumb" & FilePath
%>
<%Response.Writ e FilePath%>
Original Image:<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\") & FilePath%>"><P>

Thumbnail (% reduction):<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\Thumbs\T humb") & FilePath%>"><P>
</BODY>
</HTML>
The created thumbnail is being saved to the harddrive no problems...chee rs..

Mark Sargent.
Jul 19 '05 #6
Just a guess here but, you've said FilePath = the filename?. Are you adding
a \ between the path and the filename?

e.g. Server.MapPath( "ImageUploads\T humbs\Thumb") & "\" & FilePath

--
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*********@ho tmail.com> wrote in message
news:#M******** ******@TK2MSFTN GP12.phx.gbl...
full code below...cheers. ..

<HTML>
<HEAD>
<TITLE>AspJpe g - Simple.asp</TITLE>
</HEAD>
<BODY>
<%
Dim FilePath
if Request.QuerySt ring("FilePath" ) <> "" then
FilePath = Request.QuerySt ring("FilePath" )
End If
Response.Write FilePath
%>
<%
' Create instance of AspJpeg
Set Jpeg = Server.CreateOb ject("Persits.J peg")

' Compute path to source image
Path = Server.MapPath( FilePath)

' Open source image
Jpeg.Open Path

' Decrease image size by %
Jpeg.Width = Jpeg.OriginalWi dth / 1.1
Jpeg.Height = Jpeg.OriginalHe ight / 1.1

' Apply sharpening if necessary
' Jpeg.Sharpen 1, 130

' create thumbnail and save it to disk
FilePath = Replace(FilePat h, "/", "\")
FilePath = Replace(FilePat h, "ImageUploads\" , "")
Jpeg.Save Server.MapPath( "ImageUploads\T humbs") & "\Thumb" & FilePath
%>
<%Response.Writ e FilePath%>
Original Image:<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\") & FilePath%>"><P>

Thumbnail (% reduction):<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\Thumbs\T humb") & FilePath%>"><P>
</BODY>
</HTML>
The created thumbnail is being saved to the harddrive no problems...chee rs..
Mark Sargent.

Jul 19 '05 #7
why would I need that..? FilePath = the path minus ImageUploads/ which you
would see in the full code post. Here is how it's done, step by step...the
path passed to the page is, ImageUpoads/FileName.jpeg. I then replace / with
\ to pull the image from the drive. I then remove the path, ImageUploads\
which just leaves the image name and then save as a Thumbnail. I then want
to show the original and the created/saved Thumbnail before continuing to
delete the un-needed original and subsequently addng the Thumbnail path into
the Database. Hope that makes sense. Perhaps someone will have a quicker,
more efficient way of doing all this, just this is the best I could imagine
so far. Cheers.

Mark Sargent.
Jul 19 '05 #8
Hi All,

K, perhaps I didn't explain myself well enuff. The original file is being
resized and the thumb is being created and saved to the drive. The below
code doesn't seem to write the image to the browser, though. FilePath = just
the file name(original), example, MyPic.jpeg, which would be found here,
ImageUploads\My Pic.jpeg, on the drive. Why is this not working..? Cheers.

Mark Sargent.
<%Response.Writ e FilePath & "<br>"%>
Original Image:<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\") & FilePath%>"><P>

Thumbnail (% reduction):<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\Thumbs\T humb") & FilePath%>">

Below is the code used to save the thumb,

FilePath = Replace(FilePat h, "ImageUploa ds/", "")
Jpeg.Save Server.MapPath( "ImageUploads\T humbs") & "\Thumb" & FilePath
Jul 19 '05 #9
what does the html output look like for this line?

Stu

"Mark Sargent" <do*********@ho tmail.com> wrote in message
news:Ok******** *****@TK2MSFTNG P10.phx.gbl...
Hi All,

K, perhaps I didn't explain myself well enuff. The original file is being
resized and the thumb is being created and saved to the drive. The below
code doesn't seem to write the image to the browser, though. FilePath = just the file name(original), example, MyPic.jpeg, which would be found here,
ImageUploads\My Pic.jpeg, on the drive. Why is this not working..? Cheers.

Mark Sargent.
<%Response.Writ e FilePath & "<br>"%>
Original Image:<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\") & FilePath%>"><P>

Thumbnail (% reduction):<BR>
<IMG SRC="<%=Server. MapPath("ImageU ploads\Thumbs\T humb") & FilePath%>">

Below is the code used to save the thumb,

FilePath = Replace(FilePat h, "ImageUploa ds/", "")
Jpeg.Save Server.MapPath( "ImageUploads\T humbs") & "\Thumb" & FilePath

Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
1968
by: Ian Davies | last post by:
Hello Im having problems displaying my images as thumbnails in a table. My code for producing the new width and height from the original image is as follows ************************************************** if ($ImagePath) { //$Image = WEB_ROOT . 'images/PupilTester/' . $ImagePath; $Image = 'images/PupilTester/' . $ImagePath; } else {...
2
2205
by: Woodmon | last post by:
I'm observing issue with linked images not displaying in either Firefox 1.5b2 or IE6 when running on Win XP (they display fine in either browser on W2k). Example problem HTML is: <a href="largepict.html" title="Blah" alt="Blah" target="_new"> <img src="images/smallpict.jpg" /></a> For the image to display in either browser on XP I have...
3
3471
by: Dalan | last post by:
At first I was not certain what could cause Access 97 from displaying most jpeg images, but not all. After further testing, it seemed that all original images of less than 275 pixels per inch or less would display, but those close to 300 pixels/inch or greater would not (MS Access cannot recognize the file format xxx.jpg). The larger, original...
5
2940
by: david | last post by:
Can I use WriteFile methods? It seems that it does not work. For example, the following code only dispay one figure. Response.WriteFile("images/image002.jpg") Response.Write("<br><p>") Response.WriteFile("images/image003.jpg") Response.Write("<br><p>") Any help? Thanks
3
2290
by: ABCL | last post by:
Hi I have asp.net web site that is working well on my m/c if I access using http:// But I depyoed on production,It requiers to use https:// , If i browse tha page using https://...and on login page it doesn't link images, css and .js files on the login page. Once the user login successfully and try to browse login page agian, The images...
10
5729
by: gnewsgroup | last post by:
I've googled and tried various approaches, but could not resolve this problem. The article at MSDN: Displaying Images in a GridView Column only presents a simple case where all data (including the images) of the gridview come from a single table/datasource. Here is my situation. In my web application, I need to display customer bills info...
2
4685
by: Aneesh Pulukkul[MCSD.Net] | last post by:
Hi, I have a HTML page and associated images. I need to send the HTML as email -the email should also display the images at respective places. So am sending the content of HTML file as MailMessage.Body and adding all the referred images using MailMessage.Attachments.Add(). The images referred using <IMG SRC="Logo.png" /are displaying...
5
1888
by: Tom | last post by:
VS 2003/C# Have a axWebBrowser control that will not render images. Originally our app was just launching IE7 to display an HTML page. The bitmap images were not displaying - path was correct and HTML was correct. After converting images to JPG they started displaying OK in IE7. When we embedded the HTML in the axWebBrowser control it...
7
1974
by: Sonasang | last post by:
Hi , I am creating a web page in ASP. I will place some images in the folder, The images placed in the folder should be disaplayed. I am having the two button in the web page if I click next button then the next image should be dispalyed, If i click prev button then the prev image in the folder shd be displayed.The images are not static... its...
3
3569
by: =?Utf-8?B?UiBSZXllcw==?= | last post by:
Hi! This discussion may help other programmers get a better idea of how to save uploaded images through a website. Why? Well currently, I save 3 versions of every uploaded image on my own little website: 1. Small: DOWNsize of original image to be used as a thumbnail. 2. Medium: DOWNsize of original image to be used as user...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8117
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
932
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.