JanPRO Well-Known Member Licensed User Longtime User Jul 31, 2016 #1 Hi, currently I'am working with this WebApp example: http://basic4ppc.com:51042/websocket_with_fileupload/index.html But I have a question: Is it possible to show the upload progress? And when not: Is there a alternative? Jan
Hi, currently I'am working with this WebApp example: http://basic4ppc.com:51042/websocket_with_fileupload/index.html But I have a question: Is it possible to show the upload progress? And when not: Is there a alternative? Jan
Erel B4X founder Staff member Licensed User Longtime User Aug 1, 2016 #2 It is not possible to show the real progress. You can show a progress bar in indeterminate mode: https://jqueryui.com/resources/demos/progressbar/indeterminate.html Upvote 0
It is not possible to show the real progress. You can show a progress bar in indeterminate mode: https://jqueryui.com/resources/demos/progressbar/indeterminate.html
JanPRO Well-Known Member Licensed User Longtime User Aug 1, 2016 #3 I have found a simple solution: 1.) Add this code in your Webscoket_Connected sub: B4X: ws.Eval($" $('#id').ajaxForm({ uploadProgress: function(event, position, total, percentComplete) { b4j_raiseEvent("upload_progress",{"progress":percentComplete}); } });"$,Null) 2.) Set the id of your form 3.) Get the progress: B4X: Sub upload_progress(Params As Map) Dim Progress As Float = Params.Get("progress") Log(Progress) End Sub Jan Last edited: Aug 1, 2016 Upvote 0
I have found a simple solution: 1.) Add this code in your Webscoket_Connected sub: B4X: ws.Eval($" $('#id').ajaxForm({ uploadProgress: function(event, position, total, percentComplete) { b4j_raiseEvent("upload_progress",{"progress":percentComplete}); } });"$,Null) 2.) Set the id of your form 3.) Get the progress: B4X: Sub upload_progress(Params As Map) Dim Progress As Float = Params.Get("progress") Log(Progress) End Sub Jan