Reputation: 2915
I have a scenario in which I have to inform user about how much time their file would take to successfully upload to FTP Server
using internet. I am here if someone have any idea or suggestions on how to do that? I know that it would take the size of file and the internet speed.
More suggestion are welcome.
Thanks in advance
Upvotes: 0
Views: 811
Reputation: 3624
It can be done by sending packet of bytes
and see after how much time specific size
of data
is uploaded completely
, only then you can find out your upload speed
...
Upvotes: 0
Reputation: 284
Instead of giving an actual time estimate, I recommend using a UIProgressView object to show both overall progress and speed. Simply update the progressView.progress (which ranges from 0.0 to 1.0) each time a chunk of data is sent in your run loop. This will keep the user informed on a deeper level than simply by giving a time estimate (which would not effectively show changes in upload speed along the way).
Simply declare a UIProgressView object as a property of your uploading class, initialize it in viewDidLoad (or in the class's init method), and then use it as a standard part of your uploading process.
Upvotes: 0