Ask a Question related to ASP Database, Design and Development.
-
Krechting #1
How to show an image on my page
Hi folks,
I use an access database with a textfield (ImagePathAndFile).
In this textfield I store the full path to an image, for example:
(C:\MyDB\Images\MyImage.jpg).
Now I want to show this image in an asp page containing only one
record. Do I need an Image or an ImageLink?
I thought I put the textfield (ImagePathAndFile) on the form and
try to retrieve the value for the Image, so everytime the image
looks for the right image but I don't know how.
Regards,
MArco
The Netherlands
Krechting Guest
-
show hide image
I have small image 40 x 20 pixel and i want to allow a swap image to appear that image is 200 x 100 pixel can u advise on the best way of doing it -
Image show when mouse over?
Hi A image place holder is showing in the top left corner when the menu is moused over. Assuming you have show image place holders turned on in... -
Show image from SQL Image Field ?
Hello: I've tried showing an image field from an MS SQL Server 2000 image field on an ASP page but All I get is this... -
how to show an image from database
Carina wrote: I don't know if you can do it in PHP but what you want to do is write a separate page where you set the MIME type of the page to... -
how to show image retrieved from BLOB on the web page
Hi, Does anyone know how to retrieve binary image data from BLOB column of SQL database table and show it on the web page. I know "img src=" tag... -
Foo Man Chew #2
Re: How to show an image on my page
I would strongly recommend storing the files in a folder that is accessible
via the web, rather than c:\MyDB\Images\, you could use /images/. You could
always build the full path if you need it by using server.mappath().
Even with the full path, you could use a consistent string formatting
function to strip off the unnecessary crap from the file path and swap the
slashes around, and just say <img src="<%=fixImage(rs("ImagePath"))%>">
The way it is now, you might have to do something like this:
<img src=ImageUtility.asp?path=C:\MyDB\Images\MyImage.j pg>
Where ImageUtility.asp looks like this:
<%
FilePath = Request.Querystring("path")
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FileExists(FilePath) Then
Set ado = CreateObject("ADODB.Stream")
ado.Open()
ado.Type = 1
ado.LoadFromFile(FilePath)
Response.BinaryWrite ado.Read()
Response.End
%>
Inefficient. Gross. PITA.
"Krechting" <m.krechting@chello.nl> wrote in message
news:a71c776d.0312251620.376a8510@posting.google.c om...> Hi folks,
>
> I use an access database with a textfield (ImagePathAndFile).
> In this textfield I store the full path to an image, for example:
> (C:\MyDB\Images\MyImage.jpg).
>
> Now I want to show this image in an asp page containing only one
> record. Do I need an Image or an ImageLink?
>
> I thought I put the textfield (ImagePathAndFile) on the form and
> try to retrieve the value for the Image, so everytime the image
> looks for the right image but I don't know how.
>
> Regards,
>
> MArco
> The Netherlands
Foo Man Chew Guest
-
Krechting #3
Re: How to show an image on my page
Tnx,
But I still have some questions (I,m new in this)
If i write this image utility will I then still be able to show the
image in the same form as the rest of my record?
Do I have to make an asp file just with that piece of code?
Can't I just use <img src="<%=fixImage(rs("ImagePath"))%>">
And what is fixImage in here?
Sorry
Marco
"Foo Man Chew" <foo@man.chew> wrote in message news:<es887d0yDHA.2408@tk2msftngp13.phx.gbl>...> I would strongly recommend storing the files in a folder that is accessible
> via the web, rather than c:\MyDB\Images\, you could use /images/. You could
> always build the full path if you need it by using server.mappath().
>
> Even with the full path, you could use a consistent string formatting
> function to strip off the unnecessary crap from the file path and swap the
> slashes around, and just say <img src="<%=fixImage(rs("ImagePath"))%>">
>
> The way it is now, you might have to do something like this:
>
> <img src=ImageUtility.asp?path=C:\MyDB\Images\MyImage.j pg>
>
> Where ImageUtility.asp looks like this:
>
> <%
> FilePath = Request.Querystring("path")
> Set FSO = CreateObject("Scripting.FileSystemObject")
> If FSO.FileExists(FilePath) Then
> Set ado = CreateObject("ADODB.Stream")
> ado.Open()
> ado.Type = 1
> ado.LoadFromFile(FilePath)
> Response.BinaryWrite ado.Read()
> Response.End
> %>
>
> Inefficient. Gross. PITA.
>
>
>
>
> "Krechting" <m.krechting@chello.nl> wrote in message
> news:a71c776d.0312251620.376a8510@posting.google.c om...> > Hi folks,
> >
> > I use an access database with a textfield (ImagePathAndFile).
> > In this textfield I store the full path to an image, for example:
> > (C:\MyDB\Images\MyImage.jpg).
> >
> > Now I want to show this image in an asp page containing only one
> > record. Do I need an Image or an ImageLink?
> >
> > I thought I put the textfield (ImagePathAndFile) on the form and
> > try to retrieve the value for the Image, so everytime the image
> > looks for the right image but I don't know how.
> >
> > Regards,
> >
> > MArco
> > The NetherlandsKrechting Guest
-
Foo Man Chew #4
Re: How to show an image on my page
> Can't I just use <img src="<%=fixImage(rs("ImagePath"))%>">
fixImage would be a function that *would* turn your local path into a web> And what is fixImage in here?
path. However it doesn't seem like you've put your images in a place that
is accessible to your web site, only your local hard drive.
Foo Man Chew Guest
-
Jeff Cochran #5
Re: How to show an image on my page
On 25 Dec 2003 16:20:57 -0800, [email]m.krechting@chello.nl[/email] (Krechting)
wrote:
Store the *relative* path and/or the URL for that image. And if you>I use an access database with a textfield (ImagePathAndFile).
>In this textfield I store the full path to an image, for example:
>(C:\MyDB\Images\MyImage.jpg).
want it served via a web browser, make sure it's in your web folders
or a virtual folder under the web folders.
Jeff
Jeff Cochran Guest
-
freaky friday #6
Re: How to show an image on my page
> (C:\MyDB\Images\MyImage.jpg).
if this is for a web site, what are you doing putting those files in
C:\MyDB\? What is MyDB? Put the files in your web structure, then you can
just store the relative path, and then you can just say <img
src=<%=rs("whatever")%>>
when building a web site, stop thinking in terms of c:\
freaky friday Guest
-
Krechting #7
Re: How to show an image on my page
I use a local HD because I use a database that is also used on the machine
I'm working in with a VB shell.
But I already got the running on my local Harddrive.
I made a imagelink and when I click on the link it goes to the local HD
and shows the image in a new form, instead of what I want now in a image
on the main form.
regards
Marco
"freaky friday" <freaky@friday.net> wrote in message news:<OFzTDC9yDHA.2452@tk2msftngp13.phx.gbl>...>> > (C:\MyDB\Images\MyImage.jpg).
> if this is for a web site, what are you doing putting those files in
> C:\MyDB\? What is MyDB? Put the files in your web structure, then you can
> just store the relative path, and then you can just say <img
> src=<%=rs("whatever")%>>
>
> when building a web site, stop thinking in terms of c:\Krechting Guest
-
Mark Schupp #8
Re: How to show an image on my page
It is still not clear what your environment and expectations are.
It the end-user (the one you want to see the image in the form) logged onto
your local system with access rights to the image on your hard-drive? If
not, exactly how to they get to the page containing the form (please show
actual URL)?
Typically, an image that is to appear in a web-page is referenced by an HTTP
URL not a FILE URL. In order for this to happen the image must be in a
directory mapped to a web site. You then build the URL by concatenating the
path to the web site with the path to the file within the web site. For
instance:
web-site: [url]www.mysite.com[/url] mapped to C:\inetpub\wwwroot
images directory: C:\inetpub\wwwroot\images
Path to file pic.gif would be
[url]http://www.mysite.com/images/pic.gif[/url]
or you could use a relative path if the page containing the image were
on [url]www.mysite.com[/url]
/images/pic.gif
--
Mark Schupp
Head of Development
Integrity eLearning
[url]www.ielearning.com[/url]
"Krechting" <m.krechting@chello.nl> wrote in message
news:a71c776d.0312281109.3a328514@posting.google.c om...news:<OFzTDC9yDHA.2452@tk2msftngp13.phx.gbl>...> I use a local HD because I use a database that is also used on the machine
> I'm working in with a VB shell.
> But I already got the running on my local Harddrive.
> I made a imagelink and when I click on the link it goes to the local HD
> and shows the image in a new form, instead of what I want now in a image
> on the main form.
>
> regards
> Marco
>
> "freaky friday" <freaky@friday.net> wrote in messagecan> >> > > (C:\MyDB\Images\MyImage.jpg).
> > if this is for a web site, what are you doing putting those files in
> > C:\MyDB\? What is MyDB? Put the files in your web structure, then you> > just store the relative path, and then you can just say <img
> > src=<%=rs("whatever")%>>
> >
> > when building a web site, stop thinking in terms of c:\
Mark Schupp Guest



Reply With Quote

