1

I simply try to convert "~/Telerik.Web.UI.WebResource.axd?imgid=310aa01d42ba47e1af090c60b520dd8e&type=rbi" this path to physical path.

I simply tried below code but it throws Exception and says "Illegal characters in path".

Server.MapPath("~/Telerik.Web.UI.WebResource.axd?imgid=310aa01d42ba47e1af090c60b520dd8e&type=rbi") 

I am not exactly sure it is possible to do that or not.

Edit: I actualy have RadBinaryImage That holds the url. I want to have byte array from RadBinaryImage and this is what i try to access file.

AnyOne
  • 931
  • 2
  • 12
  • 40

3 Answers3

1

Try

Server.MapPath("~/Telerik.Web.UI.WebResource.axd") + "?imgid=310aa01d42ba47e1af090c60b520dd8e&type=rbi)"
Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
0

How about [control].ResolveUrl instead?

MapMath is looking for a file, which & is not accepted in a file path. You're just looking to get the "absolute URL" (or at least one that's folder agnostic) that the client can use.

Brad Christie
  • 100,477
  • 16
  • 156
  • 200
  • Hey i actualy have RadBinaryImage control that holds that url. The thing i want to have Byte Array of image. Is there a quick way ? – AnyOne Mar 21 '12 at 15:54
  • So you want, from that relative URL, to make a pseudo-client call and retrieve the data (image) back as a byte[]? – Brad Christie Mar 21 '12 at 16:00
  • @AnyOne: Take a look at [this question](http://stackoverflow.com/questions/5536536/change-the-requested-url-of-webresource-axd) as it may be of some help. – Brad Christie Mar 22 '12 at 13:49
0

Telerik.Web.UI.WebResource.axd is not physical resource, so it hasn't an equivalent on disk. Probably is loaded/readed from a dll by its corresponding handler.

Adrian Iftode
  • 15,465
  • 4
  • 48
  • 73