Hi,
I'm Trying to setup captcha audio for some other language, using this guide: http://www.infragistics.com/help/topic/9EB553AC-AF26-4ADB-BC48-B62606113F96
I have a folder with all sounds and CaptchaSoundsPath set on my control.
It throws an exception "Memory stream is not expandable" when trying to get audio on captcha:
Application: Error Caught in Application_Error event Error in: http://localhost/Application/WebCaptchaImage.axd?guid=7e67d887-f1ef-49cc-bb34-ec63b4ecc05f&audio=true Error Message:Memory stream is not expandable. Stack Trace: at System.IO.MemoryStream.set_Capacity(Int32 value) at System.IO.MemoryStream.EnsureCapacity(Int32 value) at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) at System.IO.BinaryWriter.Write(Char[] chars) at Infragistics.Web.UI.EditorControls.CaptchaAudioManager.GenerateHeader(MemoryStream ms, Int32 length, Int32 dataLength) at Infragistics.Web.UI.EditorControls.CaptchaAudioManager.MergeFiles(IList`1 audioFiles) at Infragistics.Web.UI.EditorControls.CaptchaImageHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I'm using .NetFramework 4 and Infragistics4.Web.v11.1 (11.1.20111.2020 version)
Hi there,
I have dissembled your dll files to check the source code and catch what suppose to be the problem.
There is the bug in your code, so changing sound path could never work. Here is your code where the problem is.
public class CaptchaImageHandler : IHttpHandler, IRequiresSessionState
...
public void ProcessRequest(HttpContext context){
....
else { string text3 = (string)context.Session["CaptchaSoundsPath"]; for (int j = 0; j < array.Length; j++) { if (char.IsDigit(array[j]) && char.IsLetter(array[j])) // THIS WILL NEVER BE TRUE { string path = string.Concat(new object[] { text3, Path.DirectorySeparatorChar, array[j], ".wav" }); if (File.Exists(HttpContext.Current.Server.MapPath(path))) { list.Add(File.ReadAllBytes(HttpContext.Current.Server.MapPath(path))); } } } }
this problem exists in the latest version Infragistics4.Web.v13.1
Hello Ivan,
With the latest service release of 13.2, I was not able to reproduce the issue. I have attached the sample I used to test this, please test it.
Please let me know if you have any further questions regarding this matter.