locked
ajaxFileUpload " The data does not correspond to valid JSON. Parameter name: data" error RRS feed

  • Question

  • User-867857476 posted

    hello guys,

    i try to use ajaxuploadfile to upload multi file but i got bellow error

    Thursday, January 22, 2015 7:55 AM

All replies

  • User-867857476 posted

    any body?

    Thursday, January 22, 2015 3:47 PM
  • User-431565850 posted

    Expand the response in the console so you can see what the actual response from the server is. That might give you some more insight as to why it cannot be deserialized. You can paste the response body here if you would like us to take a look

    Thursday, January 22, 2015 4:04 PM
  • User1711366110 posted

    Hi Mostafa,
      As per your case ,I have been shared my suggestion below :
    1.Check your AjaxToolkit version?
    2.Check the MaximumNumberOfFiles property ?
    Some sample code below :
    Default.aspx :

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
    
        <div  align="center">
            <asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" AllowedFileTypes="jpg,jpeg,png,gif"
                                MaximumNumberOfFiles="10" OnUploadComplete="File_Upload"
                                Width="500px" />
        </div>
    

    Default.aspx.cs :

    protected void File_Upload(object sender, AjaxFileUploadEventArgs e)
        {
            string filename = e.FileName;
            string strDestPath = Server.MapPath("~/Documents/");
            AjaxFileUpload1.SaveAs(@strDestPath + filename);       
        }
    

    If not yet solved, Could you post your corresponding code & error in details ?
    --
    with regards,
    Edwin

    Friday, January 23, 2015 1:53 AM
  • User-867857476 posted

    hi edwin, thanks for your answering,

    i exactly replace your code in my project but i still got above error,

    my codes already works grate but i don't know why it's not work now.

    Friday, January 23, 2015 7:10 AM