Using this URL
http://www.myWebSite.us/image.asp?pictu ... yWidth=100
results in this returned
2 keywords passed.
Key = 'pictureFile' for Item = '../pictures/x-mas 2006/Our Chariot/DSC_0001.JPG'.
Key = 'displayWidth' for Item = '100'.
GflAx object created successfully.
pictureFile = '../pictures/x-mas 2006/Our Chariot/DSC_0001.JPG'.
'Error to open file' loading picture '../pictures/x-mas 2006/Our Chariot/DSC_0001.JPG'.
'pictures' is a virtual defined on the web site which has as its source a share defined on another machine
image.asp is
Code: Select all
<%@ LANGUAGE=VBScript%>
<%Option Explicit%>
<%Response.Buffer = True%>
<%
Dim i, key, GflAx, pictureFile, actualHeight, actualWidth, displayHeight, displayWidth, displayPercent
Response.Write Request.QueryString.Count & " keywords passed." & "<br>"
For i = 1 To Request.QueryString.Count
key = Request.QueryString.Key(i)
Response.Write "Key = '" & key & "' for Item = '"
Response.Write Request.QueryString.Item(key) & "'." & "<br>"
Next
On Error Resume Next
Set GflAx = Server.CreateObject("GflAx.GflAx")
If Err <> 0 Then
Response.Write "'" & Err.Description & "' creating GflAx object." & "<br>"
Else
Response.Write "GflAx object created successfully." & "<br>"
pictureFile = Request.QueryString("pictureFile")
Response.Write "pictureFile = '" & pictureFile & "'." & "<br>"
GflAx.LoadBitmap Request.QueryString("pictureFile")
If Err <> 0 Then
Response.Write "'" & Err.Description & "' loading picture '"
Response.Write Request.QueryString("pictureFile") & "'." & "<br>"
Else
actualHeight = GflAx.height
Response.Write "Actual picture height = " & actualHeight & "." & "<br>"
actualWidth = GflAx.width
Response.Write "Actual picture width = " & actualWidth & "." & "<br>"
displayWidth = Request.QueryString("displayWidth")
Response.Write "Display width = " & displayWidth & "." & "<br>"
displayPercent = displayWidth / actualWidth
Response.Write "Display percent = " & displayPercent & "." & "<br>"
displayHeight = Round(actualHeight * displayPercent, 0)
Response.Write "Display height = " & displayHeight & "." & "<br>"
GflAx.Resize displayWidth, displayHeight
If Err <> 0 Then
Response.Write "'" & Err.Description & "' resizing picture." & "<br>"
Else
GflAx.SaveFormat = 1 ' 1 = JPEG
If Err <> 0 Then
Response.Write "'" & Err.Description & "' setting SaveFormat." & "<br>"
Else
GflAx.SaveJPEGProgressive = TRUE
If Err <> 0 Then
Response.Write "'" & Err.Description & "' setting SaveJPEGProgressive." & "<br>"
Else
GflAx.SaveJPEGQuality = 85
If Err <> 0 Then
Response.Write "'" & Err.Description & "' setting SaveJPEGQuality." &
"<br>"
Else
'Response.ContentType = "image/jpeg"
'Response.BinaryWrite GflAx.SendBinary
End If
End If
End If
End If
End If
Set GflAx = Nothing
End If
%>
?pictureFile=/pictures/x-mas%202006/Our%20Chariot/DSC_0001.JPG&displayWidth=100
(no ..) and
?pictureFile=pictures/x-mas%202006/Our%20Chariot/DSC_0001.JPG&displayWidth=100
(no ../) and additionally I've tried all 3 variations with the filepath enclosed in "s ... all with the same result.
I can display the picture with this snippet today
Code: Select all
<%
Response.Write "<img align=""center"" "
Response.Write "width=600 "
Response.Write "alt=""" & Session.Contents("objPicRecordset")("pictureFile") & """ "
Response.Write "border=0 " & vbCrLf
Response.Write "src=""" & getPictureURL(Session.Contents("objPicRecordset")("pictureFile")) & """"
Response.Write ">"
%>
intent was to replace that source parameter with "src=""" & genURL(
image.asp?pictureFile=Session.Contents("objPicRecordset")("pictureFile")&displayWidth=600) & """" and get rid of the browser width specification.
I have control over the filepath specified in the database ... I just don't understand what it needs to be to allow GflAx locate the file.
Thanks,