-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Multiple files vs single files #3
Comments
There is a new development branch called multifile on which the multiple files upload has been implemented. !!! Note, that the feature under construction and should not be used in production until review is finished and merged to master. In order to allow multiple uploads you have to (switch to the branch, of course and) define the scheme in the following way: new SimpleSchema({
pictures: {
type: Array,
optional: true,
},
'pictures.$': {
type: String,
optional: true,
label: false,
autoform: {
afFieldInput: {
type: 'fileUpload',
collection: 'Images',
multiple: "multiple",
// uploadTemplate: 'uploadField', // <- not working with custom templates yet!
// previewTemplate: 'uploadPreview' // <- Optional
}
}
}
}, {tracker: Tracker}) And create a quickForm like so:
Where It uses a queue of files as Reactive variable outside of the template instances, so it is accessible on each file input field. If the user selects multiple files the queue will be filled and the field templates will each fetch a file to upload. If a single file is selected, the old behavior is executed (immediately upload the file). A good extension would be to make the queue-ing accessible to custom templates or document for custom templates how to realize multiple uploads. |
I added this two specified schema fields to my existent schema, and here is my form tag: However, delete button doesn't delete fields from array, preview doesn't works right as well, showing same image for different objects! Also, if afFieldType is 'fileUpload', why there is mention of non-existent template 'fileUploads' in autoform.js? Is it just an unfinished and not working properly prototype? |
Thanks a lot for the investigation. I will look into it and update the branch accordingly. |
I have created an experimental repo, which we can use as foundation for discussion: https://github.com/jankapunkt/meteor-autoform-multiles-example Can you confirm, that the unwanted behavior also appears there? (P.s. you need to clone this repo into a
This dead reference is to be removed just now, thank you. |
@anjunatic did you check into the repo? |
@dr-dimitru did you have time to check into the repo? If you like it, I would make it a bit more robust and create a PR for review. |
Please keep open, new PR coming in within the next days. |
@jankapunkt 10.4 |
There is a new updated PR in this feature: #58 |
No description provided.
The text was updated successfully, but these errors were encountered: