Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 1st, 2004, 02:18 PM
Friend of Wrox
 
Join Date: Jun 2004
Location: Montreal, Quebec, Canada.
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems displaying images via a variable

Using the FileSystemObject I'd like for users to specify an image in a folder via a textfield and have that image display in a browser window for them to right click and save to their desktop, upon pressing the submit button. OnSubmit calls the follwing asp page:



***********************************************
<%
Set fso = CreateObject("Scripting.FileSystemObject")
'check for development server
checkfordevserver="\webdev\"
checkfordevserver=Server.MapPath(checkfordevserver )
%>

 <%
dim model
dim modelpic
dim getpic
model=Request.Form("model")

if model<>"" Then
    modelpic="d_"&model&".gif"


Response.Write("<img src=""../../../img/"""&modelpic&""" "">")


end if


%>


This causes a new browser window to open with the following:

<img src="../../../img/"d_HL1435.gif" ">

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

If I replace the Response.Write values with the following:

Response.Write("<img src=""../../../img/<%=modelpic%> "">")

I get the same results. BUT what I want is that image displays in the browser window for the user to right click and save to his desktop.

Any help would greatly be appreciated.
Thanks


Reply With Quote
  #2 (permalink)  
Old June 1st, 2004, 04:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

It should render the image to the screen. However, I notice that you have some extra " in your src attribute. You have:

<img src="../../../img/"d_HL1435.gif" ">

It should be:

<img src="../../../img/d_HL1435.gif">

The new response.Write line is:

Response.Write("<img src=""../../../img/" & modelpic & """>")

Try that, and let me know,

Brian
Reply With Quote
  #3 (permalink)  
Old June 2nd, 2004, 02:17 PM
Friend of Wrox
 
Join Date: Jun 2004
Location: Montreal, Quebec, Canada.
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Brian, it work out just like you said!
Thanks again for the help
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
displaying images chandan121 JSP Basics 0 May 1st, 2008 09:59 PM
Displaying images...... kethireddy435 ASP.NET 2.0 Professional 0 September 16th, 2007 09:25 PM
Displaying Images From Database Metalore BOOK: Beginning ASP.NET 2.0 and Databases 1 November 1st, 2006 11:45 AM
Images not displaying Penn_Clark Dreamweaver (all versions) 3 February 21st, 2006 12:59 PM
Displaying images inbox Classic ASP XML 2 May 4th, 2005 03:08 AM



All times are GMT -4. The time now is 02:07 AM.


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