Http Error 2 on uploading image

Last post 08-29-2016, 8:53 AM by Kenneth. 7 replies.
Sort Posts: Previous Next
  •  03-23-2014, 9:28 PM 80132

    Http Error 2 on uploading image

    Hi

     

    I have integrated RichTextEditor with my ASP.Net MVC application. After integrating I am facing issues with the Image Upload feature. When trying to upload the image using the toolbar item for "Insert Image", it immediately shows an alert with "http error 2". 

     

     

     

    After this if I try to select the path to upload the image, it shows following error: 

     

     

     

    I have done the steps listed to setup the Richtext editor as per the instructions given on site.  And, also 

    if I create a stand alone test application and take all the code from my main application to test application, image uploading does work. 

    I am not sure whats happening, as the "http error 2" is not giving enough information to understand the underlying problem.

     

    Let me know if you need any additional information. Looking for information about above issue.  

     

    Regards

    Raghav. 

  •  03-23-2014, 9:32 PM 80133 in reply to 80132

    Re: Http Error 2 on uploading image

     Hi

     

    As I am not able to see the images that I uploaded in the above post, I am not sure if the images uploaded successfully or not. Thus including the error details in text below:

     

    Error 1: Http error 2

     

    Error 2: Unable to parse /Content/richtexteditor/dialogs/uploadinfo.xml? 2013111401, failed to execute initialize: [uploadinfodialog:1], Cannot read property 'Category' of undefined, 

     

    Regards

    Raghav 

  •  03-23-2014, 9:43 PM 80134 in reply to 80133

    Re: Http Error 2 on uploading image

    Hi

     

    Just adding some more information that I got across through google:

     

    http://cutesoft.net/forums/thread/74806.aspx

    The above post shows similar problem but, it was never answered with the solution.  Thought to include if it helps. 

     

    Raghav.  

  •  03-24-2014, 10:24 AM 80142 in reply to 80134

    Re: Http Error 2 on uploading image

    Hi iFidelis,

     

    Did you set the "action" setting in the view page code? If this setting is not necessary for you, then please remove it and try again.  

     

    Also, I suggest you use the same way as the mvc demo to initialize the editor, it should fix this error for you. In the demo, it using the method below to initialize the editor.

     

    protected Editor PrepairEditor(Action<Editor> oninit) {}

     

    Regards,

     

    Ken 

  •  04-27-2014, 5:16 AM 80270 in reply to 80142

    Re: Http Error 2 on uploading image

     Hi

     

    I was able to fix the issue. Following are the steps of error occurence and fixing:

     

    a. Everything in the application was working fine, and all of a sudden one day Image Upload functionality started giving "http error 2". 

    b. I was able to find http error 2: only listed in core.js

    c. The only thing that I can do is to go through all the changes that I have made in past few days. After checking all the changes, I was able to only identify one change which potentially could cause this issue. 

    d. The change was related to Compression Attribute that I added to the MVC Controller so that the result could be compressed. 

    e. On Ajax call in Upload functionality, it was causing the issue during compression. 

    f. The fix was to remove my Custom Compression action filter for the Ajax Handler of Rich Text Editor. The change worked and upload functionality started working again. 

     

    http error 2: was certainly of no help :-(. Just wanted to share the above if it helps anyone who faces this or similar issue.  

     

    Raghav 

  •  05-06-2014, 2:36 AM 80278 in reply to 80270

    Re: Http Error 2 on uploading image

    iFidelis:

     Hi

     

    I was able to fix the issue. Following are the steps of error occurence and fixing:

     

    a. Everything in the application was working fine, and all of a sudden one day Image Upload functionality started giving "http error 2". 

    b. I was able to find http error 2: only listed in core.js

    c. The only thing that I can do is to go through all the changes that I have made in past few days. After checking all the changes, I was able to only identify one change which potentially could cause this issue. 

    d. The change was related to Compression Attribute that I added to the MVC Controller so that the result could be compressed. 

    e. On Ajax call in Upload functionality, it was causing the issue during compression. 

    f. The fix was to remove my Custom Compression action filter for the Ajax Handler of Rich Text Editor. The change worked and upload functionality started working again. 

     

    http error 2: was certainly of no help :-(. Just wanted to share the above if it helps anyone who faces this or similar issue.  

     

    Raghav 

     

    Thanks for sharing the experience.


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  08-26-2016, 3:13 PM 84325 in reply to 80278

    Re: Http Error 2 on uploading image

    I am having the same isssue as expressed above. I had everything working fine yesterday and was able to upload images but suddenly today it stopped working and I am also getting Error 2.  I changed the way I am initializing the editor according to your instructions but with no luck.

     

    Here is the initalization code in the controller:

                Editor Editor1 = PrepairEditor(delegate (Editor editor)

                {

                    editor.ID = editor.Name = "Editor1";

                    editor.Height = Unit.Pixel(400);

                    editor.Text = "Type here";

                    editor.Skin = "officexpsilver";

                    editor.Toolbar = "minimal";

                });


                ViewBag.Editor = Editor1.MvcGetString();

     

    And here is where it is called in my view:

     

     

    I have wasted hours today trying to figure out what happened and I really need your help. Thanks in advance! 

            <div class="form-group">

                @Html.LabelFor(model => model.PostContent, htmlAttributes: new { @class = "control-label col-md-2" })

                <div class="col-md-10">

                    @Html.Raw(ViewBag.Editor)

                </div>

  •  08-29-2016, 8:53 AM 84333 in reply to 84325

    Re: Http Error 2 on uploading image

    Hi PamelaN426,

     

    Does your site available on internet? If yes then can you send your editor page url to Kenneth@CuteSoft.net? So I can check on it directly.

     

    Regards,

     

    ken 

View as RSS news feed in XML