No announcement yet.
  • Filter
  • Time
Clear All
new posts

    FileItem does not allow to select multiple files from different folders


    I tried to provide different files using Browse button, it does not allow to select files from different folders on local machine though i can select more than one file at same time from single folder
    I tried to provide two different browse button to upload file from different folder, There are two different FileItem with different name. form submission gives warning

    WARN: dynamicForm: order:This DynamicForm contains more than one item of type FileItem. This is not supported - a DynamicForm can only support a single FileItem.

    server end only receive value for first FileItem.

    Based on warning, i assume client code ignore FileItem 2. Is there any work around to user select files from different folder.

    SmartGWT version - 13.0-p20221105

    FileItem myfile = new FileItem();
    myfile.setTitle("select file");
    Last edited by sidharth1917; 26 Dec 2022, 00:36.

    Did you see MultiFileItem?


      yes, i checked multifileitem but it triggers separate update server call for uploaded files and other form items and my backend service ends support only save operation and does not support save and later update existing record. So i need filetem upload functionality and other form fields that allow to save data in single network call. Another option i try to use uploaditem but that has also several limitations as per smart gwt documentation
      Last edited by sidharth1917; 28 Dec 2022, 02:47.


        Can you clarify:

        1. are you trying to upload multiple files in a single HTTP request?

        While possible, this is often not the best approach, as you can very easily hit maximum HTTP POST sizes (on your own server or intermediaries such as proxies), timeouts and other limits (again, some imposed by proxies and firewalls).

        Also, server validation errors get exponentially more complicated.

        In general, this would rarely be the right approach.

        2. you refer to limitations of "my backend", so, are you trying to save to SmartGWT's IDACall servlet (or a subclass), or to some other backend service?

        In the latter case this is not really a SmartGWT question. If you have a custom server solution here for upload, that means our technology is not providing the protocol - the most we can do is have our UI controls provide you HTML5 File objects, which they already do.

        3. [possibly not relevant based on earlier replies] what do you specifically mean when you say that your "backend service" .. "does not support save and later update existing record". We don't recognize this as something that our framework requires or expects. Can you clarify?