Results 1 to 3 of 3

Thread: ExtJs 5 File upload pointer and grid store.

  1. #1
    Touch Premium Member
    Join Date
    Mar 2012
    Posts
    115
    Answers
    13

    Default ExtJs 5 File upload pointer and grid store.

    Need to get and store the file pointer or a file upload in a store used by a grid, then be able to retrieve it to upload file.

    Converting one of our last Flex based apps to ExtJs 5.1.1.
    This is an upload application that allows user to submit files with form data (metedata)
    There is a grid with a form underneath. The user selects files and they are added to the grid.
    The user then can multi select files in the grid and associate metadata to them

    When the user submits the form it uploads the file and form data one at a time.
    Fine with logic on association of data and file.
    I understand the security limitations of browser, however need to store the file pointer in the store then be able to retrieve it.

    If I get just the file upload value its just a string, how do I store the pointer.
    I can dynamically build the form submit with the data and file pointer and upload.

    hope that all make sense
    harry

  2. #2
    Sencha User
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Out of the box, this isn't possible. However, you could potentially leverage the HTML5 API to deal with the file blobs natively (in browsers that support it, of course):

    https://developer.mozilla.org/en-US/...b_applications

    Thanks!
    Joel

  3. #3
    Touch Premium Member
    Join Date
    Mar 2012
    Posts
    115
    Answers
    13

    Default

    I have this working out of the box while only allowing the user to select one file at a time.

    User clicks button to add file. Create new window with new form with single form element "file upload". User selects file, we then grab the file upload element object and add it to the grid store. Model element type is set to auto.

    You can add as many files as you like this way. Each file then can have any metadata combination attached to it. This is done with model associations against each file in the grid store.
    Simply a dynamic form below the grid that simply applies the values to the associations to the selected file in the grid. This way each file can have any combination of metadata values.

    When the user is ready to send the file(s) we simply iterate through the grid store and get the file upload element object and attached it to a new form along with the metadata associations and submit.

    This works.

    However I would like to allow the user to select more than one file at a time. Anyway of grabbing the file upload element object and then separating each file into it's own object to allow individual file submission later.

    If I allow multiple file selection at the moment, when I do the final submit iteration it will send all the files at the same time that where attached with that input object, therefore they all have the same metadata association.

    thanks in advance
    harry

Similar Threads

  1. Replies: 1
    Last Post: 14 Sep 2015, 10:45 AM
  2. Replies: 1
    Last Post: 5 Sep 2013, 3:23 PM
  3. Replies: 1
    Last Post: 2 Oct 2012, 8:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •