ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HTTPS GET/POST with progress

I have a rather large file I'm downloading off the internet. It would be nice if I could get a progress bar to show to the user so they could cancel if needed. Also, I'd like to dump the body into a file instead of to memory. Is that possible?

0 Kudos
Message 1 of 3
(3,503 Views)

Body into file part is easy - just connect "output file" terminal on GET.vi (it's the upper one).

 

Canceling is a bit more tricky, but you can try to call GET asynchronously and abort the VI (VI is attached to the post):

get.png

Now, as of the progress bar: I'd stick with spinner. I don't think there is any sensible method to calculate progress of GET method. Just inform the user that you download something big and show spinner.

Message 2 of 3
(3,456 Views)

I need the progress bar because it's a large download and if the user is on horrible internet, I want them to see that they are 1% downloaded and not 99% downloaded so they can exit out wisely. Sounds like it's not possible. 


Also, I'm a little bit worried about the abort. That seems like it could cause something to end up in a bad state or memory leaks.

0 Kudos
Message 3 of 3
(3,431 Views)