-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO
35 lines (28 loc) · 1.3 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
TODO :
- ADD the same evt param for all callback
- ADD the SmartUpload Object to evt object
- ADD an abort event/method
DONE :
- ADD a onDone() CallBack DONE
- Check server JSON return and repost data if error after a var smartTimeout DONE
- Add an event with current part correctly posted (for progress bar etc...) DONE
=> function onProgress(current, total) where current = current number of chunk sent and total = total index
- create a smartupload.js file with a SmartUpload Object DONE
- ADD a var SMARTSIZE, with default 1048576 = 1Mo, size for use Smart chunk DONE
- ADD a var TARGET = url to send DONE
- use File API DONE
- use FileReader API DONE
-> when reader.onload :
-> get the file size
-> if file size > SMARTSIZE
-> send a request for create a blank file on the server with file size
-> split the file and send each chunk
-> else send the file directly
- in the POST request to send data : DONE
-> id : id du fichier à envoyer
-> type : type du fichier (text/html, video/mpeg4 ...)
-> data : le contenu à envoyer
-> chunkStart : la position du début de la data
-> chunkIndex : index du morceau par rapport au nombre de morceau, commence à 0
-> chunkLength : la taille du morceau data envoyé
-> chunkTotal : la taille total du fichier