[CLOSED] MultiUpload Control Issue

  1. #1

    [CLOSED] MultiUpload Control Issue

    Hi ,
    I'm used MultiFileupload example to place it in my page,when i place it(MultiFileupload and GridPanel) in a page,it works fine,it uploaded to respective directory mentinoed in Code Behind.But when i want to use MultiFileupload control as Usercontrol(I created a usercontrol with MultiFileupload and GridPanel),it raises an HTTP Error with 302 code.it doesn't hit Fileupload event.


    Thanks
    Attached Thumbnails Click image for larger version. 

Name:	MultiFileupload.png 
Views:	61 
Size:	20.6 KB 
ID:	24001  
    Last edited by Daniil; Jun 15, 2015 at 2:48 PM. Reason: [CLOSED]
  2. #2
    Hi

    Please post simple test sample which demonstrate the issue
  3. #3
    Hi

    Here I'm Using upload control in MultiFileuploadControl (UserControl) and then i use UserControl in My Page.When I Click Upload in Main Page,it displays window and then i browse the files ,click upload all ,it displays error code of 302 which i've attached sceenshot earlier post.
    Plz resolve this problem.

    FileUploadMain.aspx
        <form id="form1" runat="server">
            <ext:ResourceManager ID="rsrcmngr" runat="server" Theme="Neptune" DirectMethodNamespace="KolmeERP" />
            <ext:Viewport ID="vwprtMaster" runat="server" AutoScroll="true" Layout="BorderLayout" IDMode="Explicit"
                IsDynamic="False" Namespace="App" RenderXType="True">
                <Items>
                <ext:FormPanel ID="frmpnlDepartment" runat="server" Region="Center" AutoScroll="true" Border="false" ButtonAlign="Left">
                <Items>
     <ext:Button ID="btnStage1Files" Text="Upload" runat="server">
                                        <Listeners>
                                            <Click Handler="#{wndFileUpload}.show();" />
                                        </Listeners>
                                    </ext:Button>
                </Items>
                </ext:FormPanel>
               <ext:Window ID="wndFiles" runat="server" Hidden="true" CloseAction="Hide" Width="700"
    
                         Closable="true" ButtonAlign="Center" Title="Files" AnimCollapse="true"
                        Modal="true" AutoHeight="true" Layout="FitLayout" Height="400" AutoScroll="true">
                        <Content>
                            <uc:multifileupload id="CRMultiFileUpload" runat="server" />
                        </Content>
                    </ext:Window>
             </Items>
            </ext:Viewport>

    MultiFileUpload.ascx

    <script>
        var loadFailed = function () {
            alert("Something went wrong while loading SWFUpload. If this were a real application we'd clean up and then give you an alternative");
        };
        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.CRMultiFileUpload_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.CRMultiFileUpload_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.CRMultiFileUpload_MultiUpload1.removeUpload(records[0].getId());
        };
        var fileSelected = function (item, file) {
            if (file.name == 'image.jpg') {
                Ext.Msg.alert('Error', 'You cannot upload the file named "image.jpg"');
                return false;
            }
            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>
    <ext:GridPanel ID="UploadGrid" runat="server" Width="520" Height="300" Frame="true">
        <Store>
            <ext:Store ID="Store1" runat="server">
                <Model>
                    <ext:Model ID="Model1" runat="server" IDProperty="id">
                        <Fields>
                            <ext:ModelField Name="id" />
                            <ext:ModelField Name="name" />
                            <ext:ModelField Name="size" />
                            <ext:ModelField Name="status" />
                            <ext:ModelField Name="progress" />
                        </Fields>
                    </ext:Model>
                </Model>
            </ext:Store>
        </Store>
        <ColumnModel>
            <Columns>
                <ext:Column ID="Column1" runat="server" Text="File Name" DataIndex="name" Width="150" />
                <ext:Column ID="Column2" runat="server" Text="Size" DataIndex="size" Width="60">
                    <Renderer Format="FileSize" />
                </ext:Column>
                <ext:Column ID="Column3" runat="server" Text="&nbsp;" DataIndex="status" Width="30">
                    <Renderer Fn="statusIconRenderer" />
                </ext:Column>
                <ext:Column ID="Column4" runat="server" Text="Status" DataIndex="status" Width="60" />
                <ext:ProgressBarColumn ID="ProgressBarColumn1" runat="server" Text="Progress" DataIndex="progress" />
            </Columns>
        </ColumnModel>
        <SelectionModel>
            <ext:RowSelectionModel runat="server" ID="rowSelection">
                <Listeners>
                    <Select Handler="#{hdnfile}.setValue(record.data.name);"></Select>
                </Listeners>
            </ext:RowSelectionModel>
        </SelectionModel>
        <TopBar>
            <ext:Toolbar ID="Toolbar1" runat="server">
                <Items>
                    <ext:MultiUpload ID="MultiUpload1" runat="server" OnFileUpload="MultiUpload1_FileUpload"
                        FileDropAnywhere="true" FileSizeLimit="15 MB" FileTypes="*.*" FileTypesDescription="All Files"
                        FileUploadLimit="100" FileQueueLimit="0">
                        <Listeners>
                            <SwfUploadLoadFailed Fn="loadFailed" />
                            <FileSelected Fn="fileSelected" />
                            <UploadError Fn="uploadError" />
                            <FileSelectionError Fn="fileSelectionError" />
                        </Listeners>
                    </ext:MultiUpload>
                    <ext:ToolbarSeparator />
                    <ext:Button ID="Button1" runat="server" Text="Start Upload" Icon="Tick" Handler="#{MultiUpload1}.startUpload();" />
                </Items>
            </ext:Toolbar>
        </TopBar>
    </ext:GridPanel>
    <ext:Hidden ID="hdnfile" runat="server" />
  4. #4
    Thank you for the code.

    With some changes I was able to run these code snippets, but I could not reproduce the problem. Although, the fact that I did some changes to run it might mean that we are actually testing with different test cases.

    Also I tested with the latest Ext.NET from SVN. If you doesn't try with that, please try.

    By the way, what browsers did you test it in? I tried with IE and Chrome.

    "302" means redirection and it might mean that authentication failed. What kind of authentication do you use? There is a couple of suggestions regarding authentication:
    https://examples3.ext.net/#/MultiUpload/Basic/Overview
  5. #5
    Thank you replying Daniil,

    I'm unable to use Authentication that you described in Examples,because of i'm using different methodolgy to maintain cookies and Sessions.And session and authentication maintained at service.Is there any other way to resolve the authentication failed.
  6. #6
    Is there any other way to resolve the authentication failed.
    Personally, I am not aware of any.
    I'm unable to use Authentication that you described in Examples,because of i'm using different methodolgy to maintain cookies and Sessions.And session and authentication maintained at service.
    I am not sure why you cannot apply those suggestions. Please elaborate on that.

Similar Threads

  1. [CLOSED] Checkboxgroup control issue in IE9
    By mohan.bizbites in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 22, 2013, 5:23 AM
  2. ext control back date issue
    By atulsetu in forum 2.x Help
    Replies: 1
    Last Post: Dec 06, 2012, 3:28 PM
  3. HTML Editor Control issue
    By vbdotnetphp in forum 2.x Help
    Replies: 0
    Last Post: Sep 09, 2012, 11:14 AM
  4. User control issue
    By maephisto in forum 1.x Help
    Replies: 2
    Last Post: Apr 19, 2011, 10:54 AM
  5. [CLOSED] Control Rendering issue
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 05, 2011, 5:26 PM

Tags for this Thread

Posting Permissions