coreybryant
asked on
Cannot find a path
Currently I have:
<%
Path = "upload/"&trim(rsn("pictur e"))
'Path = Server.URLEncode(Server.Ma pPath(Path ))
%>
<a href="products.asp?style=< %=rsn("Sty leID")%>"> <IMG border=0 SRC="02_sendbinary.asp?pat h=<% = Path%>"></a></td><td>
and in 02_sendbinary.asp:
<%
Response.Expires = 0
' create instance of AspJpeg
Set Jpeg = Server.CreateObject("Persi ts.Jpeg")
' Open source file
Jpeg.Open( Request("path") )
jpeg.PreserveAspectRatio = True
If jpeg.OriginalWidth > jpeg.OriginalHeight Then
jpeg.Width = 100
Else
jpeg.Height = 100
End If
' Perform resizing and
' send resultant image to client browser
Jpeg.SendBinary
%>
Right now - all the images are in the upload folder - but it is not pulling the images.
Anything that I missed?
-Corey
<%
Path = "upload/"&trim(rsn("pictur
'Path = Server.URLEncode(Server.Ma
%>
<a href="products.asp?style=<
and in 02_sendbinary.asp:
<%
Response.Expires = 0
' create instance of AspJpeg
Set Jpeg = Server.CreateObject("Persi
' Open source file
Jpeg.Open( Request("path") )
jpeg.PreserveAspectRatio = True
If jpeg.OriginalWidth > jpeg.OriginalHeight Then
jpeg.Width = 100
Else
jpeg.Height = 100
End If
' Perform resizing and
' send resultant image to client browser
Jpeg.SendBinary
%>
Right now - all the images are in the upload folder - but it is not pulling the images.
Anything that I missed?
-Corey
ASKER
I tried that, but the code was working on another server.. So I know it should work :) - plus if I remove that 02_sendbinary - the images are the orginal size :( - way too big
-Corey
-Corey
Okay, then do you have the 02_sendbinary.asp page in your directory?
FtB
FtB
What I am thinking here is that the 02_sendbinary.asp page takes the image name as a parameter and returns a resized version. The path not found may mean that you are not pointing the .asp page or it doesn't exist.
FtB
FtB
ASKER
Yes - that is in the same folder. The images are in a folder called upload. I have tried to change that path to
<%
Path = "/upload/"&trim(rsn("pictu re"))
'Path = Server.URLEncode(Server.Ma pPath(Path ))
%>
and
<%
Path = "upload/"&trim(rsn("pictur e"))
Path = Server.URLEncode(Server.Ma pPath(Path ))
%>
but still nothing. Here is the site that is working (hosted somewhere else): http://www.aschandeliers.com/ and this one is not: http://www.shimmerlighting.com/ (hosted by me :( )
Thanks!
-Corey
<%
Path = "/upload/"&trim(rsn("pictu
'Path = Server.URLEncode(Server.Ma
%>
and
<%
Path = "upload/"&trim(rsn("pictur
Path = Server.URLEncode(Server.Ma
%>
but still nothing. Here is the site that is working (hosted somewhere else): http://www.aschandeliers.com/ and this one is not: http://www.shimmerlighting.com/ (hosted by me :( )
Thanks!
-Corey
Okay, in the 02_sendbinary.asp, how is the path set?
FtB
FtB
ASKER
I only have:
<%
Response.Expires = 0
' create instance of AspJpeg
Set Jpeg = Server.CreateObject("Persi ts.Jpeg")
' Open source file
Jpeg.Open( Request("path") )
jpeg.PreserveAspectRatio = True
If jpeg.OriginalWidth > jpeg.OriginalHeight Then
jpeg.Width = 100
Else
jpeg.Height = 100
End If
' Perform resizing and
' send resultant image to client browser
Jpeg.SendBinary
%>
in that one..
-Corey
<%
Response.Expires = 0
' create instance of AspJpeg
Set Jpeg = Server.CreateObject("Persi
' Open source file
Jpeg.Open( Request("path") )
jpeg.PreserveAspectRatio = True
If jpeg.OriginalWidth > jpeg.OriginalHeight Then
jpeg.Width = 100
Else
jpeg.Height = 100
End If
' Perform resizing and
' send resultant image to client browser
Jpeg.SendBinary
%>
in that one..
-Corey
Okay. Is the directory structure different on the two servers?
FtB
FtB
ASKER
No.. As fas I know - no. They uploaded the entire website so I would not think they would change anything
-Corey
-Corey
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Still nothing... I left it on the shimmer if you want to take a look. The parsed paths look the same
-Corey
-Corey
I am glad that you left it for me to see:
http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/557AF45-75.jpg
Now, let's see what is going on there...
ftB
http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/557AF45-75.jpg
Now, let's see what is going on there...
ftB
Okay, when I check this path, the image is indeed there:
http://www.shimmerlighting.com/upload/557AF45-75.jpg
ftB
http://www.shimmerlighting.com/upload/557AF45-75.jpg
ftB
And the source looks fine:
<IMG border=0 SRC="02_sendbinary.asp?pat h=upload/5 57AF45-75. jpg"></a>
So, have you installed the component?
FtB
<IMG border=0 SRC="02_sendbinary.asp?pat
So, have you installed the component?
FtB
Perhaps it is this line that is failing:
Server.CreateObject("Persi ts.Jpeg")
FtB
Server.CreateObject("Persi
FtB
ASKER
Yes we do have that installed: http://www.loudworx.com/test_asp_components.asp - actually have other clients using it so I know that is working..
-Corey
-Corey
But that is on a different server?
FtB
FtB
ASKER
No - one the same server. (I only have one web server right now :) )
-Corey
-Corey
So this works:
<%
Set Jpeg = Server.CreateObject("Persi ts.Jpeg")
if isObject(Jpeg) then
response.write("This is installed")
else
response.write("This is Not installed")
end if
%>
<%
Set Jpeg = Server.CreateObject("Persi
if isObject(Jpeg) then
response.write("This is installed")
else
response.write("This is Not installed")
end if
%>
ASKER
may be Jpeg.Open expects physical path? try using Server.MapPath while opening the jpeg like
Jpeg.Open( Server.MapPath(Request("pa th") ))
try the following changed code
<%
Response.Expires = 0
' create instance of AspJpeg
Set Jpeg = Server.CreateObject("Persi ts.Jpeg")
' Open source file
'Jpeg.Open( Request("path") )
Jpeg.Open( Server.MapPath(Request("pa th") ))
jpeg.PreserveAspectRatio = True
If jpeg.OriginalWidth > jpeg.OriginalHeight Then
jpeg.Width = 100
Else
jpeg.Height = 100
End If
' Perform resizing and
' send resultant image to client browser
Jpeg.SendBinary
%>
Jpeg.Open( Server.MapPath(Request("pa
try the following changed code
<%
Response.Expires = 0
' create instance of AspJpeg
Set Jpeg = Server.CreateObject("Persi
' Open source file
'Jpeg.Open( Request("path") )
Jpeg.Open( Server.MapPath(Request("pa
jpeg.PreserveAspectRatio = True
If jpeg.OriginalWidth > jpeg.OriginalHeight Then
jpeg.Width = 100
Else
jpeg.Height = 100
End If
' Perform resizing and
' send resultant image to client browser
Jpeg.SendBinary
%>
but your server is not loudworx?
FtB
FtB
@appari--
That's a good thought. Although, it didn't need that on the other server....
FtB
That's a good thought. Although, it didn't need that on the other server....
FtB
yes it expects physical path, here is the copy method explanation from reference
Sub Open(Path As String)
Opens a JPEG image for resizing. Path must be a physical path to the image.
http://www.aspjpeg.com/object_aspjpeg.html#Open
Sub Open(Path As String)
Opens a JPEG image for resizing. Path must be a physical path to the image.
http://www.aspjpeg.com/object_aspjpeg.html#Open
ASKER
yes my server is loudworx. And loudworx is on the same server as shimmer.
-Corey
-Corey
ASKER
Is there any reason why that component might not be accessible to that domain?
FtB
FtB
ASKER
when i try to browse to
http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/557AF45-75.jpg its giving the error
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'Jpeg.PreserveAspectRatio'
/02_sendbinary.asp, line 11
not the file not found error.
but when i browse to http://www.shimmerlighting.com and copy the address from the properties of first image(now no image displayed, simple red cross mark) the path is http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/61515-37.jpg it says file not found.
http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/557AF45-75.jpg its giving the error
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'Jpeg.PreserveAspectRatio'
/02_sendbinary.asp, line 11
not the file not found error.
but when i browse to http://www.shimmerlighting.com and copy the address from the properties of first image(now no image displayed, simple red cross mark) the path is http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/61515-37.jpg it says file not found.
This is very strange.
So the path looks like this now:
http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/CAL-P9642(2).jpg
Perhaps we need a / in front of upload?
FtB
So the path looks like this now:
http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/CAL-P9642(2).jpg
Perhaps we need a / in front of upload?
FtB
so in first case file exists and there is a different problem. second case image itself is not available. check it.
Ftb:
i dont this so, no need of / infront of upload.
try to browse to
http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/557AF45-75.jpg
and
http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/61515-37.jpg
i dont this so, no need of / infront of upload.
try to browse to
http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/557AF45-75.jpg
and
http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/61515-37.jpg
i dont this so--> i dont think so
ASKER
Check it out now - I took 02_sendbinary.asp?path= out - you will see some of the images are on the server (still working on that)..But you will see without that extra code - that it just is not good
-Corey
-Corey
The path looks very different on the other server:
http://www.aschandeliers.com/02_sendbinary.asp?path=G%3A%5Cwwwroot%5Caschandeliers%2Ecom%5Casuploads%5CSLC4980%281%29%2Ejpg
It looks like a physical rather than a virtual path.
FtB
http://www.aschandeliers.com/02_sendbinary.asp?path=G%3A%5Cwwwroot%5Caschandeliers%2Ecom%5Casuploads%5CSLC4980%281%29%2Ejpg
It looks like a physical rather than a virtual path.
FtB
ASKER
Yes - they were actually sharing the images on BOTH websites. They are moving hosting companies - and shimmer is the first one. But that G: etc is all pulled form the ASP code :-/
-Corey
-Corey
ok when we try to browse to
http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/CAL-P9642(2).jpg
(CAL-P9642(2).jpg is the 1st image that is displayed in your page in your chaged page.), its giving error Object doesn't support this property or method: 'Jpeg.PreserveAspectRatio' .
can you comment out line 11 in /02_sendbinary.asp and after chenging it post it here, we will check again.
http://www.shimmerlighting.com/02_sendbinary.asp?path=upload/CAL-P9642(2).jpg
(CAL-P9642(2).jpg is the 1st image that is displayed in your page in your chaged page.), its giving error Object doesn't support this property or method: 'Jpeg.PreserveAspectRatio'
can you comment out line 11 in /02_sendbinary.asp and after chenging it post it here, we will check again.
i think there are two problems.
1. few images are missing
2. even though image exists, becoz of "Object doesn't support this property or method: 'Jpeg.PreserveAspectRatio' " error they are displayed as image missing cross.
1. few images are missing
2. even though image exists, becoz of "Object doesn't support this property or method: 'Jpeg.PreserveAspectRatio'
ASKER
Line 11 in my orginal or yours? I still have yours there right now. (but right now - I am not even using the 02_sendbinary)
-Corey
-Corey
ok replace with this one
<%
Response.Expires = 0
' create instance of AspJpeg
Set Jpeg = Server.CreateObject("Persi ts.Jpeg")
' Open source file
'Jpeg.Open( Request("path") )
Jpeg.Open( Server.MapPath(Request("pa th") ))
''''jpeg.PreserveAspectRat io = True
If jpeg.OriginalWidth > jpeg.OriginalHeight Then
jpeg.Width = 100
Else
jpeg.Height = 100
End If
' Perform resizing and
' send resultant image to client browser
Jpeg.SendBinary
%>
<%
Response.Expires = 0
' create instance of AspJpeg
Set Jpeg = Server.CreateObject("Persi
' Open source file
'Jpeg.Open( Request("path") )
Jpeg.Open( Server.MapPath(Request("pa
''''jpeg.PreserveAspectRat
If jpeg.OriginalWidth > jpeg.OriginalHeight Then
jpeg.Width = 100
Else
jpeg.Height = 100
End If
' Perform resizing and
' send resultant image to client browser
Jpeg.SendBinary
%>
ASKER
hm getting somewhere :) I commented jpeg.PreserveAspectRatio = True out
-Corey
-Corey
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
now http://www.shimmerlighting.com/ seems working properly
ASKER
Well we are getting there. if you want - call it a night :) and I will have my programmer work on it when he gets up in a couple of hours :)
-Corey
-Corey
No problem, if you have any problem post it here,
i have to wait another 10-12 hours to say good night:), i am based in Tokyo
I found the same thing--that when I put the paths in directly, the pictures were there.
However, these two paths loook very different. appari suggested earlier that a physical path might be necessary, and that is what it looks like on the second url:
<IMG border=0 SRC="02_sendbinary.asp?pat h=upload/5 57AF45-75. jpg"></a>
http://www.aschandeliers.com/02_sendbinary.asp?path=G%3A%5Cwwwroot%5Caschandeliers%2Ecom%5Casuploads%5CSLC4980%281%29%2Ejpg
What I would do is create a page called where.asp and put it in your root. The code should be this:
<%
response.write(Server.MapP ath("where .asp"))
%>
Once you have the full physiical path, you can just add /upload/ to the end of it and then use that in your script. That should solve the problem.
FtB
However, these two paths loook very different. appari suggested earlier that a physical path might be necessary, and that is what it looks like on the second url:
<IMG border=0 SRC="02_sendbinary.asp?pat
http://www.aschandeliers.com/02_sendbinary.asp?path=G%3A%5Cwwwroot%5Caschandeliers%2Ecom%5Casuploads%5CSLC4980%281%29%2Ejpg
What I would do is create a page called where.asp and put it in your root. The code should be this:
<%
response.write(Server.MapP
%>
Once you have the full physiical path, you can just add /upload/ to the end of it and then use that in your script. That should solve the problem.
FtB
ASKER
Actually it seems to be working - amzing what a few beers and a good night sleep will do :) - here is what was added / changed:
<%
Response.Expires = 0
Set Image = Server.CreateObject("csIma geFile.Man age")
Image.Readfile Server.MapPath(Request("pa th"))
if Image.width > Image.height then
Image.Resize 100,0
else
Image.Resize 0,100
end if
Response.ContentType = "Image/Jpeg"
Response.AddHeader "Content-Disposition", "inline; filename=img" & index & ".jpg"
Response.BinaryWrite Image.JPGData
set Image=nothing
response.end
' create instance of AspJpeg
Set Jpeg = Server.CreateObject("Persi ts.Jpeg")
' Open source file
'Jpeg.Open( Request("path") )
Jpeg.Open( Server.MapPath(Request("pa th") ))
''''jpeg.PreserveAspectRat io = True
'If jpeg.OriginalWidth > jpeg.OriginalHeight Then
' jpeg.Width = 100
' Else
' jpeg.Height = 100
'End If
' New width
L = 100
' Resize, preserve aspect ratio
'Jpeg.PreserveAspectRatio = True
Jpeg.Width = L
Jpeg.Height = Jpeg.OriginalHeight * L / Jpeg.OriginalWidth
' Perform resizing and
' send resultant image to client browser
Jpeg.SendBinary
%>
-Corey
<%
Response.Expires = 0
Set Image = Server.CreateObject("csIma
Image.Readfile Server.MapPath(Request("pa
if Image.width > Image.height then
Image.Resize 100,0
else
Image.Resize 0,100
end if
Response.ContentType = "Image/Jpeg"
Response.AddHeader "Content-Disposition", "inline; filename=img" & index & ".jpg"
Response.BinaryWrite Image.JPGData
set Image=nothing
response.end
' create instance of AspJpeg
Set Jpeg = Server.CreateObject("Persi
' Open source file
'Jpeg.Open( Request("path") )
Jpeg.Open( Server.MapPath(Request("pa
''''jpeg.PreserveAspectRat
'If jpeg.OriginalWidth > jpeg.OriginalHeight Then
' jpeg.Width = 100
' Else
' jpeg.Height = 100
'End If
' New width
L = 100
' Resize, preserve aspect ratio
'Jpeg.PreserveAspectRatio = True
Jpeg.Width = L
Jpeg.Height = Jpeg.OriginalHeight * L / Jpeg.OriginalWidth
' Perform resizing and
' send resultant image to client browser
Jpeg.SendBinary
%>
-Corey
I am glad that you have this sorted out.
FtB
FtB
ASKER
Me to. It took a lot of time. and with y'alls help - it seems to work!
-Corey
-Corey
<IMG border=0 SRC="<% = Path%>">
Might be better?
FtB