Closed dcardosods closed 8 years ago
You can change it by adding the flowInit like this:
<div class="col" flow-init flow-name="obj.flow">
Then on your $scope there will be a variable like $scope.obj.flow. Now you can manipulate the options by changing the values in $scope.obj.flow.opts. Eg.
$scope.obj.flow.opts.target = "NEWUPLOADPATH";
$scope.obj.flow.upload();
It will now use whatever you set NEWUPLOADPATH to as the path to upload to.
I'm already using flow-name
and I'm able to change target and other options.
But in my use case I need to assign chunkSize
when a file is added. I tried doing that on the fileAdded
event, but this event is fired after the file is already split in chunks, i.e., inside the bootstrap
method, which makes setting scope.obj.flow.opts.chunkSize = newSize
irrelevant.
@dcardosods, have you tried using the initFileFn as documented in https://github.com/flowjs/flow.js/blob/master/README.md ?
Let us know your feedback and eventually load here your working snippet!
@evilaliv3 initFileFn
was exactly what I needed. Thanks!
PS: It's documented the function expects 2 params, but only a FlowFile is provided to it.
Is there any way other to set options, except
.config
andflow-init
?In my use case I want to change
chunkSize
depending on the sum off all files' size added to upload.