Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Any way to add active reload of headers, formData etc. #1

Open
vgogov opened this issue Feb 22, 2017 · 1 comment
Open

Any way to add active reload of headers, formData etc. #1

vgogov opened this issue Feb 22, 2017 · 1 comment

Comments

@vgogov
Copy link

vgogov commented Feb 22, 2017

Hello,

Currently I have a text box to go along with the uploader. When a user types in that textbox it should take that value and append it to the headers or formData options. Anyway guidance on to implement that?

Cheers!

@Denfie
Copy link
Member

Denfie commented Feb 26, 2017

Hi vgogov,

just put it to the formData options. Like:

this.uploader = new FileUploader({
    url: 'https://example.com',
    {
        formData: [
            { FildName: FieldValue }
        ]
    }
});

OR you can use the rewrite function.

this.uploader = new FileUploader({
    url: 'https://example.com'
});

// this.uploader.onBeforeUpload(_file: FileManager): void { return; }
this.uploader.onBeforeUpload = (_file: any): void => { 
    _file.options.formData.push({ FildName: FieldValue });
}

Both ways are possible. There is also a way to hook into this BeforeUpload but this way is to long for this comment. Feel free to close.

I will continue with my wiki the next days :D

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

No branches or pull requests

2 participants