Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
AJAX error while trying to get the file size.
posted

There appears to be a curious situation that makes the upload control fail. I created a new mvc.net web site using Visual Studio 2010 which gave me a default web site complete with login ability and two pages; home and index.

I proceed to modify the Index page for the home controller to incorporate the igUpload control as per the samples in the documentation and that found on this link

http://blogs.infragistics.com/blogs/damyan_petev/archive/2011/09/03/using-netadvantage-jquery-upload-control-in-asp-net-mvc.aspx

Finally I published this to an application within the Default website on my Windows7 PC.

When I navigated to the web site's url as follows

http://mymachine/myuploadtest

the page would render with the upload control shown. When I pressed the upload button and selected a file I got the error; "AJAX error while trying to get the file size."

Using the tool Fiddler I discovered that the URL the control was trying to browse was incorrect; below is the URL it was trying to hit.

http://mymachine/ig_fua34sf345sdf13sdf3454erdsf2345asd3425df5235d54df345.aspx?key=psMXpct6PVoGCccu8XX4vsscqxVeNN&command=fileSize

Looking at this URL it is wrong because it should have added to the path "myuploadtest" following the machine name; instead it was trying to browse a URL directly on the machine.

HOWEVER, if I browsed to the web site using the same URL as before but this time ending the URL with a forward slash as follows;

http://mymachine/myuploadtest/

Then everything works fine and again using Fiddler I can see that the correct URL is browsed.

I was using the product version 2011.1

This is worrying for I won't be able to control how a user navigates to the site and if anything it is the exception to end URLs for a forward slash.

The is a sense of urgency for I need to decide in the next week whether to proceed with Infragistics or another product. Can you please advise.

Cheers.

 

 

 

Parents
  • 1800
    Verified Answer
    posted

    Hi,

    I think your problem is caused by non-properly configured path to the HttpHandler

    <add verb="GET" type="Infragistics.Web.Mvc.UploadStatusHandler" path="IGUploadStatusHandler.ashx" />

    You should set properly value for the path - I propose you to test with "/"  for the path of httphandler

    <add verb="GET" type="Infragistics.Web.Mvc.UploadStatusHandler" path="/IGUploadStatusHandler.ashx" />

    If you use FireBug in Firefox OR DeveloperTools in IE(or other tool for checking website requst/responses for your browser) you can check what exactly requests are made and whether path to the httpHandler is properly set.

    Thanks,

    Miro Hristov

Reply Children
No Data