locked
AjaxFileUpload dialog box - cant select multiple files RRS feed

  • Question

  • User-1312778766 posted

    vs express 2012

    targetFramework="4.0"

    IE10

    install ajax toolkit via manage nuGet packages for solution - and tried to reinstall it...

    the prob: 

    on dialog box - cant select multiple files... just one at the time.

    i would like to have the same behavior like in the ajax control tool kit oficial page..

    add in web.config:

    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <handlers>
          <add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler,            AjaxControlToolkit"/>
        </handlers>
      </system.webServer>

    <form id="form1" runat="server">
            <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
            </asp:ToolkitScriptManager>
            <div>
                <asp:Label runat="server" ID="myThrobber" Style="display: none;"><img align="absmiddle" alt="" src="images/uploading.gif"/></asp:Label>
                <asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server"
                    OnUploadComplete="AjaxFileUpload1_UploadComplete" 
                    ThrobberID="myThrobber" MaximumNumberOfFiles="10" AllowedFileTypes="jpg,jpeg,gif" />
            </div>
        </form>
    
    protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
        {
            //string filePath = "~/upload/" + e.FileName;
            //AjaxFileUpload1.SaveAs(filePath);
    
        }




     

    Tuesday, April 1, 2014 7:20 AM

All replies

  • User1208776063 posted

    on dialog box - cant select multiple files... just one at the time.

    Did you try holding CTRL key to select multiple files? When you set MaximumNumberOfFiles to 10, you should be able to select 10 files.

    Tuesday, April 1, 2014 8:00 AM
  • User-1312778766 posted

    yas i did..

    tried to fallow tutorials as well..

    like this one for exemple:

    http://stephenwalther.com/archive/2012/05/01/ajax-control-toolkit-may-2012-release

    on:

    IE10:  browser:Mode IE10 documentMode:Standards

    chrome:33

    FF:28

    Tuesday, April 1, 2014 8:33 AM
  • User-417640953 posted

    Hi 2xo1,

    Thanks for your post.

    In my mind the ajax control AjaxFileUpload will generate file input with Multiple attribute.

    <input name="AjaxFileUpload1$ctl04" type="file" id="AjaxFileUpload1_Html5InputFile" multiple="multiple" style="opacity:0;-moz-opacity:0.0;filter:alpha(opacity=0);display:none;visibility:hidden;" />

    The multiple attribute supported in html5, and html5's attributes not fits all browsers.

    http://www.w3schools.com/tags/att_input_multiple.asp

    You can try below javascript code for test whether your broswer support multiple (select multiple files ).

    function supportMultiple() {
    	//do I support input type=file/multiple
    	var el = document.createElement("input");
    
    	return ("multiple" in el);
    
    }

    Hope that helps, thanks.

    Best Regards!

    Wednesday, April 2, 2014 6:53 AM
  • User-1312778766 posted

    for shore i have tried on

    IE10:  browser:Mode IE10 documentMode:Standards

    chrome:33

    FF:28

    and with the 

    <meta http-equiv="x-ua-compatible" content="IE=edge" >

    and tried to add 

    multiple="multiple"

    to the asp:AjaxFileUpload control...

    but i will have to mantion that the example in the ajaxCOntrolToolKit website its working fine... 

    and the html tag working fine

                <input type="file" name="file" multiple="multiple" id="xx" accept="image/*" />

    Friday, April 11, 2014 8:57 AM