i display file upload progress in progress bar on web page while uploading file amazon s3 …
on web page select file file input calls controller ajax post request .
in controller extract file posted request.
var hpf = request.files[1];
then call method uses amazons3client..
uploadvideomultipart(hpf.inputstream,filename)
this above method completes upload s3 fine , during process repeatedly sends number bytes uploaded .
public static void uploadpartprogresseventcallback(object sender, streamtransferprogressargs e) {// process event. var progress = (string.format("{0}/{1}", e.transferredbytes, totalcontentlength)); }
example:
transferredbytes totalbytes
8778 152652556
2562 152652556
how can send data uploadpartprogresseventcallback browser without stopping upload thread.
if data able update progress bar.
you need communicate between server client
signalr saviour here in situation ,with of signalr gains ability push content server side clientside.
entire documentation here signalr@github
you can follow these
web resources well
(assuming have gone through above link)
now coming need ,
you can hook signalr broadcast ie can call client method , manage groups outside hub class
an example beautifully explained here in example
although new api learn if not familiar,but trust me won't take time grasp it,
Comments
Post a Comment