Hi,
I’m using an ashx to get images in a mailmerge. It is something similar to this:
…/getImg.ashx?f=picutre.jpg
It gives me an error:
Exception 'Cannot load image from field 'PictureField'. The field contains data in unsupported format. Illegal characters in path.' occured in Aspose.Words for .NET 5.2.2.0.
For free technical support, please post this error and the file in the Aspose.Words Forums <https://forum.aspose.com/c/words/8>.
If I change the route to for example “…/picture.jpg”, it works fine. And if I run getImg.ashx?f=picutre.jpg at the browser, I can see the image.
This is (reduced), what the ashx does:
context.Response.Clear();
context.Response.ClearContent();
context.Response.Cache.SetExpires(DateTime.Now.AddDays(1));
context.Response.Cache.SetSlidingExpiration(true);
context.Response.Cache.SetValidUntilExpires(true);
context.Response.Cache.VaryByParams["n"] = true;
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.ContentType = "image/Jpeg";
context.Response.AddHeader("Content-Length", pict.Length.ToString());
if (context.Response.IsClientConnected)
{
context.Response.BinaryWrite(pict);
context.Response.Flush();
context.Response.End();
}
¿Any idea?
Thanks