Closed dukhevych closed 6 years ago
Has anyone looked into this? Guys? Hello?
There is a closed issue for this. You just have to find it. I think you have to add it to flow js only then it is valid but I can't remember for sure.
Is there any reference to the other issue? I have the same requirement and want to know how to proceed.
Add file --> POST /targetUrl/{flowIdentifier}/init (size: xxx, totalChunks: yyy.....) If succeeds then add file to $flow If fail display an error message (e.g. extension mismatch, server out of disk space, etc)
I did this by generating the pre-signed url in flow.on('fileAdded', file => .....
and had my ajax call in there. After that, I added a key to the file object called uploadUrl. Then, I put a simple resolver function in the target
in the flow config. For each file, this target
is called, and the function, just returns uploadUrl
for the individual file object, thereby enabling you to send different files to different pre-signed urls.
I need to make async calls to prepare upload for every file (in response i get file's targetUrl, also this call is used to validate user's quota for files uploading).
Is it possible?
Purpose is to start upload of every file which got targetUrl from async call. If I want to upload 1000 files, i don't want to wait for all prepare upload async calls, because it may take a very long time.
I tried to return Promise in
target
property of a flow object, but it didn't work.