Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload mutiple files? #88

Open
adummy832 opened this issue Apr 10, 2019 · 4 comments
Open

Upload mutiple files? #88

adummy832 opened this issue Apr 10, 2019 · 4 comments

Comments

@adummy832
Copy link

Is there any way to upload multiple files in a single go and
save them in different directories using supplied metadata?

Referenced some useful link/s here:

@sffc
Copy link
Owner

sffc commented Apr 10, 2019

I posted an answer on that StackOverflow question. However, this seems like a reasonable feature to add, and it wouldn't be too hard. Here's how I'd do it (all changes in client.js):

  • listenOnSubmit:
    • pass input as the second argument to _baseFileSelectCallback
  • _baseFileSelectCallback:
    • add a second argument named element
    • pass it to the "choose" event in the object literal: element: element
    • note: if element is undefined (not passed to _baseFileSelectCallback), then that value will be undefined in the object literal, which is fine

@sffc
Copy link
Owner

sffc commented Apr 10, 2019

Oh, and then the answer would be adding a listener on the "choose" event in userland, which would now have access to the file metadata and can add information based on the element the input came from.

In terms of saving the files in different directories, no, that's not going to be possible right now. However, if you add the information you want to the file.meta, you can just move the files on the server after they are finished uploading.

@sffc
Copy link
Owner

sffc commented Apr 10, 2019

If you want to make a PR, I'll be happy to review it for you.

@adummy832
Copy link
Author

I wasn't expecting @sffc would reply within a day! 😎
Btw, thanks for this dude! Really loving this library 🎉
Right now i'm workin' on some stuff but i'll submit a PR. Thanks again. 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants