[CLOSED] MultiUpload MVC response error in IE 11

Page 1 of 3 123 LastLast
  1. #1

    [CLOSED] MultiUpload MVC response error in IE 11

    I have implemented the multipupload control on an MVC page. The control is posting to my controller, and the files are being successfully sent to my database via a WCF service method. The page works fine in Firefox and Chrome, but in IE 11 (and also IE 10 emulation), a response error message is thrown. I have used the F12 tools and VS debugging, but cannot find where the response message comes from or why.

    I am supplying the code and screen shot. In the screen shot, you will notice two response errors - one for each of the files uploaded. Any idea what could be happening?

    Html.X().MultiUpload()
          .ID("MultiUpload1")
          .FileDropAnywhere(true)
          .FileSizeLimit("15 MB")
          .FileTypes("*.*")
          .FileTypesDescription("All Files")
          .FileUploadLimit(20)
          .FileQueueLimit(0)
          .UploadUrl(Url.Action("MultiUpload", "Distribution", new { area = "Report", id = Model.GeneratedDistributionId }))
          .Listeners(l =>
          {
              l.SwfUploadLoadFailed.Fn = "loadFailed";
              l.FileSelected.Fn = "fileSelected";
              l.FileSelectionError.Fn = "fileSelectionError";
              l.UploadStart.Handler = "updateRecord(file.id, 'status', 'Sending');";
              l.UploadProgress.Handler = "updateRecord(file.id, 'progress', Math.round(bytesComplete / bytesTotal));";
              l.UploadComplete.Handler = "updateRecord(file.id, 'progress', 1); updateRecord(file.id, 'status', 'Uploaded');";
              l.UploadAborted.Handler = "updateRecord(file.id, 'status', 'Aborted');";
              l.UploadRemoved.Handler = "var store = this.up('grid').store; store.remove(store.getById(file.id));";
              l.UploadError.Fn = "uploadError";
          }),
      Html.X().ToolbarSeparator(),
      Html.X().Button()
          .Text("Start Upload")
          .Icon(Icon.PageGo)
          .Handler("#{MultiUpload1}.startUpload();"),
      Html.X().Button()
          .Text("Abort")
          .Icon(Icon.PageCancel)
          .Handler("abortUpload"),
      Html.X().Button()
          .Text("Abort All")
          .Icon(Icon.PageCancel)
          .Handler("#{MultiUpload1}.abortAllUploads();"),
      Html.X().Button()
          .Text("Remove")
          .Icon(Icon.PageDelete)
          .Handler("removeUpload"),
      Html.X().Button()
          .Text("Remove All")
          .Icon(Icon.PageDelete)
          .Handler("#{MultiUpload1}.removeAllUploads(); selectedFiles = new Array();")
    [HttpPost]
    public ActionResult MultiUpload(int id, FileUploadEventArgs e)
    {
        if (e.HasFile)
        {
            HttpPostedFile file = e.PostedFile;
            Logger.LogMessage(String.Format("Adding attachment '{0}' for GeneratedDistributionId {1}", file.FileName, id));
    
            var svc = ReportService;
            bool isNewAttachment = svc.AddGeneratedDistributionAttachment(id, file.FileName, file.ContentType, file.InputStream.ToByteArray(), User.Identity.Name);
        }
        else
        {
            Logger.LogMessage("No file present in upload.");
        }
    
        return this.Direct();
    }
    Attached Thumbnails Click image for larger version. 

Name:	multipupload.png 
Views:	205 
Size:	26.5 KB 
ID:	9171  
    Last edited by Daniil; Sep 27, 2014 at 7:56 AM. Reason: [CLOSED]
  2. #2
    Hi @jpadgett,

    Please try
    return new DirectResult() { IsUpload = true };
    instead of
    return this.Direct();
  3. #3
    The IsUpload setting should not be required for a MultiUpload control.

    I could not reproduce the issue.

    Could you, please, provide us with a full test case? Ideally, we should be able to copy, paste and run the code without any changes from our side.
  4. #4
    Before posting, I did try the IsUpload param in the return. I also added the session id and forms auth params (per the example), but that didn't affect the issue either. Here is a working sample I have on my local that produces the issue for me:

    @{
        Layout = null;
    }
    
    <!DOCTYPE html>
    
    <html>
    <head>
        <meta name="viewport" content="width=device-width" />
        <title>MultiUpload</title>
    
        <script type="text/javascript">
            var loadFailed = function () {
                alert("The SWFUpload control could not load. Please make sure you have flash enabled.");
            };
    
            var statusIconRenderer = function (value) {
                switch (value) {
                    default:
                        return value;
                    case 'Pending':
                        return '<img src="' + Ext.net.ResourceMgr.getIconUrl("Hourglass") + '" width=16 height=16>';
                    case 'Sending':
                        return '<div src="x-loading-indicator" width=16 height=16>';
                    case 'Error':
                        return '<img src="' + Ext.net.ResourceMgr.getIconUrl("Decline") + '" width=16 height=16>';
                    case 'Cancelled':
                    case 'Aborted':
                        return '<img src="' + Ext.net.ResourceMgr.getIconUrl("Decline") + '" width=16 height=16>';
                    case 'Uploaded':
                        return '<img src="' + Ext.net.ResourceMgr.getIconUrl("Tick") + '" width=16 height=16>';
                }
            };
    
            var updateRecord = function (id, field, value) {
                var rec = App.UploadGrid.store.getById(id);
    
                rec.set(field, value);
                rec.commit();
            };
    
            var abortUpload = function (btn) {
                var selModel = btn.up('grid').getSelectionModel(),
                    records;
    
                if (!selModel.hasSelection()) {
                    Ext.Msg.alert('Error', 'Please select an upload to cancel.');
                    return true;
                }
    
                records = selModel.getSelection();
                App.MultiUpload1.abortUpload(records[0].getId());
            };
    
            var removeUpload = function (btn) {
                var selModel = btn.up('grid').getSelectionModel(),
                    records;
    
                if (!selModel.hasSelection()) {
                    Ext.Msg.alert('Error', 'Please select an upload to remove.');
                    return true;
                }
    
                records = selModel.getSelection();
                App.MultiUpload1.removeUpload(records[0].getId());
    
                selectedFiles.splice(selectedFiles.indexOf(records[0].data.name), 1);
            };
    
            var selectedFiles = new Array();
    
            var fileSelected = function (item, file) {
                if (selectedFiles.indexOf(file.name) > -1) {
                    Ext.Msg.alert('Error', '"' + file.name + '" has already been added to the upload queue.');
                    return false;
                }
    
                selectedFiles.push(file.name);
    
                this.up('grid').store.add({
                    id: file.id,
                    name: file.name,
                    size: file.size,
                    status: 'Pending',
                    progress: 0
                });
            };
    
            var uploadError = function (item, file, errorCode, message) {
                updateRecord(file.id, 'progress', 0);
                updateRecord(file.id, 'status', 'Error');
    
                switch (errorCode) {
                    case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
                        alert("Error Code: HTTP Error, File name: " + file.name + ", Message: " + message);
                        break;
                    case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
                        alert("Error Code: Upload Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
                        break;
                    case SWFUpload.UPLOAD_ERROR.IO_ERROR:
                        alert("Error Code: IO Error, File name: " + file.name + ", Message: " + message);
                        break;
                    case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
                        alert("Error Code: Security Error, File name: " + file.name + ", Message: " + message);
                        break;
                    case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
                        alert("Error Code: Upload Limit Exceeded, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
                        break;
                    case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
                        alert("Error Code: File Validation Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
                        break;
                    case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
                        updateRecord(file.id, 'status', 'Cancelled');
                        break;
                    case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
                        updateRecord(file.id, 'status', 'Stopped');
                        break;
                    default:
                        updateRecord(file.id, 'status', "Unhandled Error: " + errorCode);
                        alert("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
                        break;
                }
            };
    
            var fileSelectionError = function (item, file, errorCode, message) {
                if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
                    alert("You have attempted to queue too many files.\n" + (message === 0 ? "You have reached the upload limit." : "You may select " + (message > 1 ? "up to " + message + " files." : "one file.")));
                    return;
                }
    
                switch (errorCode) {
                    case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
                        alert("Error Code: File too big, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
                        break;
                    case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
                        alert("Error Code: Zero byte file, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
                        break;
                    case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
                        alert("Error Code: Invalid File Type, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
                        break;
                    default:
                        alert("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
                        break;
                }
            };
        </script>
    </head>
    <body>
        @Html.X().ResourceManager()
    
        @(Html.X().Viewport()
            .Layout(LayoutType.Anchor)
            .Padding(10)
            .Items(
                Html.X().GridPanel()
                    .ID("UploadGrid")
                    .Title("Upload")
                    .Width(520)
                    .Height(300)
                    .Frame(true)
                    .Store(
                        Html.X().Store()
                            .Model(
                                Html.X().Model()
                                    .IDProperty("id")
                                    .Fields(
                                        Html.X().ModelField().Name("id"),
                                        Html.X().ModelField().Name("name"),
                                        Html.X().ModelField().Name("size"),
                                        Html.X().ModelField().Name("status"),
                                        Html.X().ModelField().Name("progress")
                                    )
                            )
                    )
                    .ColumnModel(
                        Html.X().Column().Text("File Name").DataIndex("name").Width(210),
                        Html.X().Column()
                            .Text("Size")
                            .DataIndex("size")
                            .Width(60)
                            .Renderer(new Renderer() { Format = RendererFormat.FileSize }),
                        Html.X().Column()
                            .Text("&nbsp;")
                            .DataIndex("status")
                            .Width(30)
                            .Renderer(new Renderer() { Fn = "statusIconRenderer" }),
                        Html.X().Column().Text("Status").DataIndex("status").Width(60),
                        Html.X().ProgressBarColumn().Text("Progress").DataIndex("progress")
                    )
                    .TopBar(
                        Html.X().Toolbar()
                            .Items(
                                Html.X().MultiUpload()
                                    .ID("MultiUpload1")
                                    .FileDropAnywhere(true)
                                    .FileSizeLimit("15 MB")
                                    .FileTypes("*.*")
                                    .FileTypesDescription("All Files")
                                    .FileUploadLimit(20)
                                    .FileQueueLimit(0)
                                    .UploadUrl(Url.Action("MultiUpload"))
                                    .Listeners(l =>
                                    {
                                        l.SwfUploadLoadFailed.Fn = "loadFailed";
                                        l.FileSelected.Fn = "fileSelected";
                                        l.FileSelectionError.Fn = "fileSelectionError";
                                        l.UploadStart.Handler = "updateRecord(file.id, 'status', 'Sending');";
                                        l.UploadProgress.Handler = "updateRecord(file.id, 'progress', Math.round(bytesComplete / bytesTotal));";
                                        l.UploadComplete.Handler = "updateRecord(file.id, 'progress', 1); updateRecord(file.id, 'status', 'Uploaded');";
                                        l.UploadAborted.Handler = "updateRecord(file.id, 'status', 'Aborted');";
                                        l.UploadRemoved.Handler = "var store = this.up('grid').store; store.remove(store.getById(file.id));";
                                        l.UploadError.Fn = "uploadError";
                                    }),
                                Html.X().ToolbarSeparator(),
                                Html.X().Button()
                                    .Text("Start Upload")
                                    .Icon(Icon.PageGo)
                                    .Handler("#{MultiUpload1}.startUpload();"),
                                Html.X().Button()
                                    .Text("Abort")
                                    .Icon(Icon.PageCancel)
                                    .Handler("abortUpload"),
                                Html.X().Button()
                                    .Text("Abort All")
                                    .Icon(Icon.PageCancel)
                                    .Handler("#{MultiUpload1}.abortAllUploads();"),
                                Html.X().Button()
                                    .Text("Remove")
                                    .Icon(Icon.PageDelete)
                                    .Handler("removeUpload"),
                                Html.X().Button()
                                    .Text("Remove All")
                                    .Icon(Icon.PageDelete)
                                    .Handler("#{MultiUpload1}.removeAllUploads(); selectedFiles = new Array();")
                            )
                    )
            )
        )
    </body>
    </html>
    [AllowAnonymous]
    public ActionResult MultiUpload()
    {
        return View();
    }
    
    [HttpPost]
    public ActionResult MultiUpload(FileUploadEventArgs e)
    {
        if (e.HasFile)
        {
            HttpPostedFile file = e.PostedFile;
            X.Msg.Notify("Upload", "You have uploaded: " + file.FileName).Show();
        }
        else
        {
            X.Msg.Notify("Upload", "No file").Show();
        }
    
        return this.Direct();
    }
  5. #5
    Please clarify is the issue reproducible with IE11 only? Is it reproducible in Chrome, FireFox?
  6. #6
    I am only getting the issue in IE 11, and IE 10 emulation in the F12 tools.

    I am not having any issues in Firefox or Chrome.
  7. #7
    I tested with BrowserStack in Win 7 + IE11 and the issue doesn't appear for me.

    Maybe, some project settings cause the problem. Could you provide us with an entire project to test with?

    Or, maybe, some IE11 settings in your specific IE instance or a problem with Flash. Hard to say.
  8. #8
    I am using:
    • Windows 7 64-bit.
    • IE 11 version 11.0.9600.16521
    • Shockwave Flash version 12.0.0.77


    Don't know if that info helps. Maybe the 64-bit?
  9. #9
    I created a test project with two MVC 5 web apps. The first one I used the Ext.NET.MVC.2.5.0 nuget package. On the second one, I used the Ext.NET.MVC5.2.5.0 package. I'm not sure what the difference is between the two, but I got the same results from both - they both reproduced the response error message.

    The zip file for the project is ~181 MB. How do I send it to you?
  10. #10
    We need the only project to reproduce, not both. You can upload a project to somewhere and provide us with a link to download.
Page 1 of 3 123 LastLast

Similar Threads

  1. MultiUpload Issue (error Code 200)
    By stebag in forum 2.x Help
    Replies: 10
    Last Post: Apr 10, 2014, 11:45 AM
  2. [CLOSED] multiUpload error from 5692
    By CPA1158139 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 02, 2014, 12:23 PM
  3. [CLOSED] JavaScript Error on MultiUpload inside ext:Window
    By kevinhwang in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 10, 2014, 10:54 AM
  4. [CLOSED] Multiupload error code
    By Digital.Dynamics in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 23, 2013, 4:32 AM
  5. [FIXED] [2.4] MultiUpload selection limit error
    By xtremexploit in forum Bugs
    Replies: 13
    Last Post: Nov 04, 2013, 5:01 AM

Tags for this Thread

Posting Permissions