473,385 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

help hiding image paths



anyone know a useful way of hiding image paths so images on my site cant be
directly linked to?
ive seen sites that use <img src="image.asp?/moo/fred/image01.jpg"> (where
the path starts from www.domain.com/secretfolder/moo/fred/image01.jpg) but
dont know how to set this up

BTW am on a shared host so dont have the use of base level administration if
it makes any difference?

anyone help me?
mark


Jul 22 '05 #1
10 2921
"mark | r" <tr*********@hotmail.com> wrote in message
news:42***********************@news.dial.pipex.com ...
:
: anyone know a useful way of hiding image paths so images on my site cant
be
: directly linked to?
: ive seen sites that use <img src="image.asp?/moo/fred/image01.jpg"> (where
: the path starts from www.domain.com/secretfolder/moo/fred/image01.jpg) but
: dont know how to set this up
:
: BTW am on a shared host so dont have the use of base level administration
if
: it makes any difference?

You would actually put the folder outside the web root, not beneath it.

<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True

Function ReadBinaryFile(FileName)
Const adTypeBinary = 1
Dim BinaryStream
Set BinaryStream = CreateObject("ADODB.Stream")
BinaryStream.Type = adTypeBinary
BinaryStream.Open
BinaryStream.LoadFromFile FileName
ReadBinaryFile = BinaryStream.Read
End Function

Const strPath = "c:\images\"
dim path, gifdata, file
file = "logo.gif"
path = strPath & file
gifdata = ReadBinaryFile(path)
Response.ContentType = "image/gif"
Response.Buffer = True
Response.Clear
Response.BinaryWrite gifdata
Response.Flush
%>

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #2

"Roland Hall" <nobody@nowhere> wrote in message
news:OQ**************@TK2MSFTNGP14.phx.gbl...


"mark | r" <tr*********@hotmail.com> wrote in message
news:42***********************@news.dial.pipex.com ...
:
: anyone know a useful way of hiding image paths so images on my site cant
be
: directly linked to?
: ive seen sites that use <img src="image.asp?/moo/fred/image01.jpg"> (where : the path starts from www.domain.com/secretfolder/moo/fred/image01.jpg) but : dont know how to set this up
:
: BTW am on a shared host so dont have the use of base level administration if
: it makes any difference?

You would actually put the folder outside the web root, not beneath it.

<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True

Function ReadBinaryFile(FileName)
Const adTypeBinary = 1
Dim BinaryStream
Set BinaryStream = CreateObject("ADODB.Stream")
BinaryStream.Type = adTypeBinary
BinaryStream.Open
BinaryStream.LoadFromFile FileName
ReadBinaryFile = BinaryStream.Read
End Function

Const strPath = "c:\images\"
dim path, gifdata, file
file = "logo.gif"
path = strPath & file
gifdata = ReadBinaryFile(path)
Response.ContentType = "image/gif"
Response.Buffer = True
Response.Clear
Response.BinaryWrite gifdata
Response.Flush
%>

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp MSDN Library - http://msdn.microsoft.com/library/default.asp


is that the image.asp file? and i guess i should use response.queystring to
get the filename and set the types to jpeg etc?

Mark


Jul 22 '05 #3
"mark | r" wrote in message
news:42***********************@news.dial.pipex.com ...
: "Roland Hall" <nobody@nowhere> wrote in message
: news:OQ**************@TK2MSFTNGP14.phx.gbl...
: >
: >
: > "mark | r" <tr*********@hotmail.com> wrote in message
: > news:42***********************@news.dial.pipex.com ...
: > :
: > : anyone know a useful way of hiding image paths so images on my site
cant
: > be
: > : directly linked to?
: > : ive seen sites that use <img src="image.asp?/moo/fred/image01.jpg">
: (where
: > : the path starts from www.domain.com/secretfolder/moo/fred/image01.jpg)
: but
: > : dont know how to set this up
: > :
: > : BTW am on a shared host so dont have the use of base level
: administration
: > if
: > : it makes any difference?
: >
: > You would actually put the folder outside the web root, not beneath it.
: >
: > <%@ Language=VBScript %>
: > <%
: > Option Explicit
: > Response.Buffer = True
: >
: > Function ReadBinaryFile(FileName)
: > Const adTypeBinary = 1
: > Dim BinaryStream
: > Set BinaryStream = CreateObject("ADODB.Stream")
: > BinaryStream.Type = adTypeBinary
: > BinaryStream.Open
: > BinaryStream.LoadFromFile FileName
: > ReadBinaryFile = BinaryStream.Read
: > End Function
: >
: > Const strPath = "c:\images\"
: > dim path, gifdata, file
: > file = "logo.gif"
: > path = strPath & file
: > gifdata = ReadBinaryFile(path)
: > Response.ContentType = "image/gif"
: > Response.Buffer = True
: > Response.Clear
: > Response.BinaryWrite gifdata
: > Response.Flush
: > %>
: >
:
: is that the image.asp file? and i guess i should use response.queystring
to
: get the filename and set the types to jpeg etc?

If it's a link and you're passing the name on the URL, yes, use
Request.QueryString. The ContentType would need to be the appropriate MIME
type for the file being read.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #4
And here's a related link:

Serving Dynamic Images from Static Web Pages - 5/24/2000
http://www.4guysfromrolla.com/webtech/052400-1.shtml

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Jul 22 '05 #5
http://www.aspfaq.com/2276

anyone know a useful way of hiding image paths so images on my site cant be directly linked to?

Jul 22 '05 #6
Where I want the image displayed I put <img src="_invoiceImage.asp">

in _invoiceImage.asp I have:

<%
iImg = session("uid")
Set ctrl = server.createobject("GflAx.GflAx")
const AX_JPEG = 3
With ctrl
.enablelzw= True
.LoadBitmap server.MapPath("/invoiceimages/" & iImg & ".jpg")

iMaxW = 320
iMaxH = 130
if .width > iMaxW or .height > iMaxH then
if .width > .height then
iRatio = iMaxW / .width
else
iRatio = iMaxH / .height
end if
iImgW = .width * iRatio
iImgH = .height * iRatio
.Resize iImgW, iImgH
end if
.Saveformat = AX_JPEG

response.contenttype = "image/jpeg"
response.binarywrite .SendBinary
end with

set ctrl=nothing

%>

This finds the image based on the uid stored inthe session object and does
some resizing but I am sure you can modify this to your needs.

Duane.

"mark | r" <tr*********@hotmail.com> wrote in message
news:42***********************@news.dial.pipex.com ...


anyone know a useful way of hiding image paths so images on my site cant
be
directly linked to?
ive seen sites that use <img src="image.asp?/moo/fred/image01.jpg"> (where
the path starts from www.domain.com/secretfolder/moo/fred/image01.jpg) but
dont know how to set this up

BTW am on a shared host so dont have the use of base level administration
if
it makes any difference?

anyone help me?
mark

Jul 22 '05 #7
> Set ctrl = server.createobject("GflAx.GflAx")

What DLL is this? Where did you get it?
Jul 22 '05 #8
Aaron Bertrand [SQL Server MVP] wrote:
Set ctrl = server.createobject("GflAx.GflAx")

What DLL is this? Where did you get it?

Sorry, I should have said...It's a free dll, http://www.xnview.com/ or
http://perso.wanadoo.fr/pierre.g/xnview/engfl.html
Jul 22 '05 #9
Aaron Bertrand [SQL Server MVP] wrote:
Set ctrl = server.createobject("GflAx.GflAx")

What DLL is this? Where did you get it?

Sorry, I should have said...It's a free dll, http://www.xnview.com/ or
http://perso.wanadoo.fr/pierre.g/xnview/engfl.html
Jul 22 '05 #10
"Duane Jackson" wrote in message news:42**************@keyone.co.uk...
: Aaron Bertrand [SQL Server MVP] wrote:
: >>Set ctrl = server.createobject("GflAx.GflAx")
: >
: > What DLL is this? Where did you get it?
: >
: Sorry, I should have said...It's a free dll, http://www.xnview.com/ or
: http://perso.wanadoo.fr/pierre.g/xnview/engfl.html

It probably won't do you much good if your site is hosted.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #11

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

Similar topics

5
by: DaveB | last post by:
I have to come up to speed quickly on PHP since I have been given the responsibilty of updating our website. I have setup a local web server through IIS, downloaded and installed PHP. I'm using...
3
by: William Starr Moake | last post by:
Is there a script to convert image file paths from absolute to just img src="imagename.jpg"? This is for an IE-based WYSIWYG editor. The doImage execCommand produces an absolute file path, which...
3
by: Bill Brother | last post by:
Is it possible to retrieve the local full path of an image ( not the url )?
6
by: bissatch | last post by:
Hi, I am currently writing a news admin system. I would like to add the ability to add images to each article. What I have always done in the past is uploaded (using a form) the image to a...
5
by: john | last post by:
Here is the short story of what i'm trying to do. I have a 4 sided case labeling printer setting out on one of our production lines. Now then i have a vb.net application that sends data to this...
4
by: web_design | last post by:
I put this together from some other scripts I am using on a site. I'm trying to make a better email hiding script. It isn't working. Also, it causes Internet Explorer 6 SP2 to block the script...
10
by: FX | last post by:
I wanna publish a script on my site which allows me to hide image source. i have rough idea abt it. i`ll point src to some php page like: <img src="image.php"> & in tht php wat exactly shud be...
7
by: smerf | last post by:
I am trying to write a personal spider to crawl through websites and create a highly specialized personal list of sites and pages that I may like to see based on preferences that I have supplied. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.