I am using ng-flow directive for uploading files to server. Is there a way i can use normal upload instead of chunked upload that is used in ng-flow module?
Asked
Active
Viewed 1,709 times
3 Answers
7
You could set the chunkSize
to a very high value (e.g., 9007199254740992, javascripts largest integer value).
var app = angular.module('app', ['flow']).
config(['flowFactoryProvider', function (flowFactoryProvider) {
flowFactoryProvider.defaults = {
target: '/upload',
permanentErrors: [404, 500, 501],
chunkSize: 9007199254740992,
maxChunkRetries: 1,
chunkRetryInterval: 5000,
testChunks: false
};
}]);

neXus
- 2,005
- 3
- 29
- 53
3
Yes, you can set property testChunks: false to config flow, for example:
var app = angular.module('app', ['flow']).
config(['flowFactoryProvider', function (flowFactoryProvider) {
flowFactoryProvider.defaults = {
target: '/upload',
permanentErrors: [404, 500, 501],
maxChunkRetries: 1,
chunkRetryInterval: 5000,
simultaneousUploads: 4,
testChunks: true
};
}]);

VelikiiNehochuha
- 3,775
- 2
- 15
- 32
-
2`testChunks` does not enable or disable chunked uploads. What it does is disable the check to see which chunks were uploaded before. This way, the file upload can be resumed even after a browser crash/restart. – neXus Apr 13 '15 at 08:35
0
For me, both of the 2 methods given doesn't work. When looking at the doc I have found a configuration attribute called testMethod
setting this to null solved the problem for me :
var app = angular.module('app', ['flow']).
config(['flowFactoryProvider', function (flowFactoryProvider) {
flowFactoryProvider.defaults = {
testMethod: null
};
}]);

Moussa
- 4,066
- 7
- 32
- 49