Last post Nov 26, 2006 03:29 AM by SLORider
Nov 20, 2006 12:32 PM|pete_m|LINK
I am using a method to secure my images whereby the image folder is below the root of the website on the server. The images are fetched from an intermediatory page getimage.aspx.
. ie: [img src="getimage.asp?img=imagenamehere.jpg" /]
This has worked very well for me up to now displaying images in a browser. However, I need to get the images into a DataDynamics Webviewer.
My code is as follows:
pic.Image = System.Drawing.Image.FromFile(path + txt.Value);
Where the path = common\getimage.aspx?img=test161193020.gif
When I run this page I get an error saying "Invalid characters in path".
The images that are displayed in the browser have a url of: common%5Cgetimage.aspx?img=test161193128.jpg
(when looking at: right click, properties)
Is the slash my problem? Does anyone know how to sort this one out?
Nov 20, 2006 06:35 PM|surfer5|LINK
Try using a forward slash in your path. In other words, set you path to something like:
I don't know if that is the problem or not. Generally speaking, browsers will resolve the slash if it is going the wrong direction. But in the context you are trying to use it, you may not have that luxury. And to be properly formatted, the relative path
should have a forward slash.
See if that works.
Nov 21, 2006 05:20 AM|pete_m|LINK
I did try changing the slash but unfortunately I'm still getting the error. Is it the question mark used for the querystring do you think? In which case I think I'm screwed.
Nov 21, 2006 06:12 AM|pete_m|LINK
OK, I'm not sure what the issue was really as the getimage.aspx file returns an image type.
Anyway, I have 'solved' it by using an actual physical path (as I know what it will be).
Nov 26, 2006 03:29 AM|SLORider|LINK