Skip to content

Add formData before upload #97

@iruindegi

Description

@iruindegi

Hi, this is my controller:

    var uploader = $scope.uploader = $fileUploader.create({
        scope: $scope,                          
        url: '/doUpload',
        formData: [
            {
                key: 'value',
                izena:''
            }
        ]
    });

What I need is to include a new field called "izena" where I have my upload path and more data.

This is all the stuff I tried on "beforeupload" event:

    uploader.bind('beforeupload', function (event, item) {
        console.info('Before upload', item);
        var temp_izena = items[0].file.name;
        var izena = temp_izena.substr(0, temp_izena.lastIndexOf('.'));
        izena = izena + datuGuztiak;
        $('#izena').val(izena);
        $('#izena').text(izena);
        uploader.formData.push({ izena: izena });
        uploader.formData.izena = "jejejjejej";
        item.izena = "jajajjaj";
    });

but it is not working.. I can not see this param on my request on node.js

Whitch is the correct way to add new fields to upload?

thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions