Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 28th, 2004, 08:28 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default images are displayed (inconsistently)


I am calling images from a folder using FSO. Everything is working fine EXCEPT that the images sometimes appear in a new browser window, and sometimes they don't. I have set up the code so that when the user enters the model number, the code sniffs thru the folder and if that image is found, a hyperlink to that image is displayed (response.write). Once clicked that image pops up in a new browser window. Writing the hyperlinks works fine, tis when the user clicks that hyperlink that the image is sometimes replace by the default (image not available icon).

Any help would greatly be appreciated. Let me know what snippets of code you would need to review, too.

One last note: the images are jpeg but are huge (~1meg). However that doesn't seem to be the problem because some smaller images don't appear and other bigger ones do???

Thanks
 
Old June 28th, 2004, 10:40 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Why images are being called using FSO, as these images can be
displayed using <IMG tag..


Om Prakash
 
Old June 29th, 2004, 08:13 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using FSO because the folder I am referring to is constantly growing in its content (number of files). Therefore, with a consistant filenaming convention, I do not have to embed the links onto the HTML page but rather have the code look into folder to find a match.

 
Old June 29th, 2004, 08:17 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Hi,

 Can you paste the code, which actually displays the image and writes the <A... tag



Om Prakash
 
Old June 29th, 2004, 08:35 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sure, here it is:
Of course "modelhr" is the name of the textfield in the form:

**********************************************

  <%
dim fsohr
dim pichrurl
dim strpath1
dim modelhr
dim modelhrpic
dim gethrpic
modelhr=Request.Form("modelhr")

if modelhr<>"" Then


'this code checks the existance of a image file to display the product image
'================================================= ===============
Set fsohr = CreateObject("Scripting.FileSystemObject")

pichrurl="\img\hires\" & modelhr & ".jpg"

strpath1=Server.MapPath(pichrurl)

If (fsohr.FileExists(strpath1)) Then

Response.Write("<P class=""locator"" style=""margin-bottom: -10px;"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<img src=""../img/icon.gif"">&nbsp;&nbsp;&nbsp;<a href="""&pichrurl&""" target=_blank class=""locator"" title="""&modelhr&"""&nbsp;image"">"""&modelhr&""" &nbsp;&nbsp;image</a></P>" )


Else
    Response.Write("<P class=""locator"" style=""margin-top: -5px;"">"""&modelhr&"""&nbsp;&nbsp;image unavailable</P>" )
        End If
end if


%>

**********************************************

 
Old July 9th, 2004, 10:18 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've checked this section (FSO) in ASP.3.0 For Beginner's but couldn't find an explanation for this inconsistent behaviour??

I am still having the same problem. The code recognizes the image in the folder because it "writes" its link onto the webpage. HOWEVER, when clicking that link the image is replaced by the standard missing image icon???

I have already included my chunk of code as per the moderator's request, but have not heard back since???

Any help in resolving this would greatly be appreciated!
Thanks
 
Old July 9th, 2004, 11:03 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Nancy,

Have you checked that the offending images have security set so that that the internet guest account can see them?

HTH,

Chris

 
Old July 9th, 2004, 12:13 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm sorry I don't quite understand what you mean by: "have security set so that that the internet guest account can see them?"

Could you kindly explain?
Thanks Chris
 
Old July 9th, 2004, 01:25 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Nancy,

I assume because you are using the fso you are windows based.

If you can look at the image files in windows explorer, right click, select properties -> security. Check out which groups have access to the file & what kind of access.

You may find that access is restricted to admin / system or some other combination, in which case the fso may find them, but an internet guest will not be allowed to access them.

Best regards,

Chris








Similar Threads
Thread Thread Starter Forum Replies Last Post
Load Images from and Save Images to a Database cyndie VB.NET 2 August 17th, 2008 06:42 AM
Page cannot be displayed. Voltron ASP.NET 2.0 Basics 0 October 22nd, 2006 04:20 PM
saving images that are displayed on applets Kiran Kumar Java Basics 0 April 5th, 2006 01:21 AM
Why is it that the page cannot be displayed? gilgalbiblewheel Classic ASP Databases 2 April 10th, 2005 08:17 AM
time displayed damnnono_86 Access 2 November 28th, 2003 01:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.