Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set single file in ng-flow

I need to use the single-file attribute in the ng-flow, i have to use it because this attribute other than limits the nuber of file to send, substitute the file thate was added until the upload event, see this:

singleFile Enable single file upload. Once one file is uploaded,
second file will overtake existing one, first one will be canceled. (Default: false)

this is the documentation taken from flow.js git repository.
What i really need to do is to put this attribute in the factory, because i need to set this for all my input file field. I have try to search it in the ng-flow documentation, but it lack of a lot of explanaion, anyone know how to do this? Otherwise anyone know where to find a complete good docummentation of this module?

like image 660
mautrok Avatar asked May 22 '14 13:05

mautrok


2 Answers

Or using a tag like this:

<div flow-init="{target: '/upload', singleFile: true}"></div>
like image 111
Vladimir Trifonov Avatar answered Nov 15 '22 05:11

Vladimir Trifonov


You could try setting it like this:

.config(['flowFactoryProvider', function (flowFactoryProvider) {
    flowFactoryProvider.defaults = {
        singleFile: true
    };
}])
like image 35
TheHouseplant Avatar answered Nov 15 '22 05:11

TheHouseplant