We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Uploadbox post sometimes missing controller name?

Thread ID:

Created:

Updated:

Platform:

Replies:

117812 Dec 18,2014 09:52 PM UTC Dec 23,2014 10:04 AM UTC ASP.NET MVC 3
loading
Tags: Uploadbox
Matthew Cestarte
Asked On December 18, 2014 09:52 PM UTC

I have a simple Uploadbox in an MVC 5 page which sometimes correctly posts to the controller’s upload method (/SyncFusion/Upload) but at seemingly random times it posts without the controller name, so it ends up at a location that does not exist (/Upload). Of course I tried adding the controller name into the SaveUrl but it breaks again when next the Uploadbox begins including the controller name. Any suggestions?


Here is the Uploadbox in question.


@{
    var uploadBoxProperties = new UploadboxProperties {
        AsyncUpload = true,
        SaveUrl = "Upload",
        MultipleFilesSelection = true,
        ShowFileDetails = true,
        UploadBoxButtonText = new UploadboxButtonText {
            Browse = "Add Files",
        }
    };
    @Html.EJ().Uploadbox("postedFiles", uploadBoxProperties)
}


Attachment: Razor_f7ae1ed7.zip

Sasikala Nagarajan [Syncfusion]
Replied On December 19, 2014 11:32 AM UTC

Hi Matthew,

Thanks for using Syncfusion products

We have analyzed your given query “Location that does not exist (/Upload)” and we suspect that the cause of the issue may be mismatch of URL. If we run the sample at “http://localhost:XXXX/” location, and try to upload a file from this path, it’s try to search for “upload” a method in http://localhost:XXXX/upload which one is does not exists. So its returns the “404 not found” error.

So please run the sample from URL (“http://localhost:XXXX/Home/Index”) with controller name and view page specified. Or else provide the SaveUrl as “<Controller-name> /action name” (for example “/Home/upload”).

Please find the below code snippet

[_cshtml]

@{

        var uploadBoxProperties = new UploadboxProperties

                {

                    AsyncUpload=true,

                    SaveUrl = "/Home/upload",

                    MultipleFilesSelection = true,

                    ShowFileDetails = true,

                    UploadBoxButtonText = new UploadboxButtonText

                    {

                        Browse = "Add Files",

                    }

                };

                }

    @Html.EJ().Uploadbox("postedFiles", uploadBoxProperties)

 

Upload method works fine in both URL (http://localhost:XXXX/Home/Index, http://localhost:XXXX/) when we specify the SaveUrl with Controller name (“SaveUrl = "/Home/upload",).

Also, we need to clarify that whether the given response meets your requirement or we misunderstood, if so could please provide more details about the requirement and it will be easy for us to provide the exact solution.

Please let us know if you need any further assistance,

Regards,

Sasikala Nagarajan


Matthew Cestarte
Replied On December 22, 2014 06:15 PM UTC

Thank you, Sasikala.  It is working.

Previously in my attempts which yielded different results (like posting to /SyncFusion/SyncFusion/Upload), I must have missed the beginning '/' so my SaveUrl was "SyncFusion/Upload" instead of "/SyncFusion/Upload".

Sasikala Nagarajan [Syncfusion]
Replied On December 23, 2014 10:04 AM UTC

Hi Matthew Cestarte,

Thanks for the update,

Please let us know if you need any further assistance,

Regards,
Sasikala Nagarajan


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;