K
Kelly
Help,
So I'm doing the common make thumbnails script. to save server space, I
don't want to store the thumbnails, so I did the classic break up script.
I parse on the main page where it gathers the folders, files and their
paths, then I pass them over into the sendbinary.asp page which does all the
editing.
First of all this works.
basically the final output creates this:
<IMG
SRC="scripts/sendBinary.asp?path=c%3A%5Csite%5Cafolder%5CDC%5Cboat%5CIM001693%2EJPG">
but, as you can tell, I'm passing over the full information and it writes
the hard drive information where everyone can see it. I went into trying to
pass two variables to the sendbinary page. I tried storing the path as a
session variable and then just passing the image name. That didn't work
(example below).
Is there a way to combine path information... and or hide it from users? I
even tried to get it to do a mappath while in the sendbinary page and that
didn't work. It seems like something like this would work, but it doesn't.
Could anyone offer some advice? A different plan of attack?
Here are some variations I've tried...
1st the output string:
<IMG SRC="scripts/sendBinary.asp?imgname=IM001693%2EJPG">
also, I created a session variable to track the physical path location:
<%
Session("PhysicalPath") = "c%3A%5Csite%5Cafolder%5CDC%5Cboat%5C"
%>
here's how I've altered the code to try to break it into chunks inside the
sendbinary.asp
<%
Response.ContentType = "image/jpeg"
Set Image = Server.CreateObject("AspImage.Image")
path = Request.QueryString("path")
imgname = Request.QueryString("imgname")
Upath = Session("PhysicalPath")
AllPath = Session("PhysicalPath") & Request.QueryString("imgname")
'Image.LoadImage(path)
'the above works if I remove the quote
Image.LoadImage(AllPath)
'I get red x boxes because it can't find the image.
Image.JPEGQuality = 20
' Set new height and width
Dim intXSize, intYSize, intWSize,intHSize
intWSize = 337
intHSize = 62
'scale image so width of whole image is the same as width of
thumbnail
intXSize = intWSize
intYSize = Image.MaxY * intXSize / Image.MaxX
'resize the image
Image.ResizeR intXSize, intYSize
'crop the image x, y, width, height
Image.cropimage 0,((intYSize+intHSize)/2),intWSize,intHSize
Response.BinaryWrite Image.Image
Set Image = nothing
%>
What am I doing wrong?
Thanks very much,
Kelly
So I'm doing the common make thumbnails script. to save server space, I
don't want to store the thumbnails, so I did the classic break up script.
I parse on the main page where it gathers the folders, files and their
paths, then I pass them over into the sendbinary.asp page which does all the
editing.
First of all this works.
basically the final output creates this:
<IMG
SRC="scripts/sendBinary.asp?path=c%3A%5Csite%5Cafolder%5CDC%5Cboat%5CIM001693%2EJPG">
but, as you can tell, I'm passing over the full information and it writes
the hard drive information where everyone can see it. I went into trying to
pass two variables to the sendbinary page. I tried storing the path as a
session variable and then just passing the image name. That didn't work
(example below).
Is there a way to combine path information... and or hide it from users? I
even tried to get it to do a mappath while in the sendbinary page and that
didn't work. It seems like something like this would work, but it doesn't.
Could anyone offer some advice? A different plan of attack?
Here are some variations I've tried...
1st the output string:
<IMG SRC="scripts/sendBinary.asp?imgname=IM001693%2EJPG">
also, I created a session variable to track the physical path location:
<%
Session("PhysicalPath") = "c%3A%5Csite%5Cafolder%5CDC%5Cboat%5C"
%>
here's how I've altered the code to try to break it into chunks inside the
sendbinary.asp
<%
Response.ContentType = "image/jpeg"
Set Image = Server.CreateObject("AspImage.Image")
path = Request.QueryString("path")
imgname = Request.QueryString("imgname")
Upath = Session("PhysicalPath")
AllPath = Session("PhysicalPath") & Request.QueryString("imgname")
'Image.LoadImage(path)
'the above works if I remove the quote
Image.LoadImage(AllPath)
'I get red x boxes because it can't find the image.
Image.JPEGQuality = 20
' Set new height and width
Dim intXSize, intYSize, intWSize,intHSize
intWSize = 337
intHSize = 62
'scale image so width of whole image is the same as width of
thumbnail
intXSize = intWSize
intYSize = Image.MaxY * intXSize / Image.MaxX
'resize the image
Image.ResizeR intXSize, intYSize
'crop the image x, y, width, height
Image.cropimage 0,((intYSize+intHSize)/2),intWSize,intHSize
Response.BinaryWrite Image.Image
Set Image = nothing
%>
What am I doing wrong?
Thanks very much,
Kelly