Item additionalParams are not used #1035

Open
opened 2018-07-16 15:19:31 +00:00 by undefined-user-ctrl · 0 comments
undefined-user-ctrl commented 2018-07-16 15:19:31 +00:00 (Migrated from github.com)

Hi,

I need to make several different requests when user drops a folder (I know that's an existing topic), and i manage to do that with some kind of control. But that would be much easier if the item.option property get used in the method:
FileUploader.prototype._xhrTransport = function (item)

Bellow follows one suggestion

lines~ 358

 // For AWS, Additional Parameters must come BEFORE Files
            if (this.options.additionalParameter !== undefined) { **//THIS should check if item has a option.additionalParameters, otherwise use this.options....**
                Object.keys(this.options.additionalParameter).forEach(function (key) {
                    var paramVal = _this.options.additionalParameter[key];
                    // Allow an additional parameter to include the filename
                    if (typeof paramVal === 'string' && paramVal.indexOf('{{file_name}}') >= 0) {
                        paramVal = paramVal.replace('{{file_name}}', item.file.name);
                    }
                    sendable.append(key, paramVal);
                });
            }

Thanks, love the project, fit very well all my needs, but with this slight change i could make the queue be realistic.

Also, If anyone want to i can show how i implemented Folder Upload, maybe for an enhancement.

Hi, I need to make several different requests when user drops a folder (I know that's an existing topic), and i manage to do that with some kind of control. But that would be much easier if the item.option property get used in the method: FileUploader.prototype._xhrTransport = function (item) Bellow follows one suggestion lines~ 358 ``` // For AWS, Additional Parameters must come BEFORE Files if (this.options.additionalParameter !== undefined) { **//THIS should check if item has a option.additionalParameters, otherwise use this.options....** Object.keys(this.options.additionalParameter).forEach(function (key) { var paramVal = _this.options.additionalParameter[key]; // Allow an additional parameter to include the filename if (typeof paramVal === 'string' && paramVal.indexOf('{{file_name}}') >= 0) { paramVal = paramVal.replace('{{file_name}}', item.file.name); } sendable.append(key, paramVal); }); } ``` Thanks, love the project, fit very well all my needs, but with this slight change i could make the queue be realistic. Also, If anyone want to i can show how i implemented Folder Upload, maybe for an enhancement.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#1035