4
$\begingroup$

Would it be possible to have some sort of progress indicator for downloading files?

For example if we would like to import: Import["http://lieanalysis.com/exampledata/os.mx"]

It would take a while, it would be nice if you have some sort of progress indicator (like mathematica uses for ExampleData)

$\endgroup$
1
  • $\begingroup$ @Kuba can't believe i've missed that. Thanks $\endgroup$ Commented Dec 6, 2016 at 13:52

1 Answer 1

3
$\begingroup$

Use URLSaveAsynchronous to download, then Import the downloaded file. There's an example in the documentation about progress bars.

Be aware that I experienced some problems with this function. In version 11 sometimes it would get stuck after the download has finished. See the discussion:

$\endgroup$
3
  • $\begingroup$ Thanks for your answer, somehow I must have overlooked this function. Will accept you answer when I'm allowed :) $\endgroup$ Commented Dec 6, 2016 at 13:53
  • $\begingroup$ @FrankMartin Well, there's URLSave, URLFetch, URLFetchAsynchronous, URLSubmit, URLDonwload, URLRead, Import, HTTPRequest and so on and so on. Some are deprecated and won't show up in auto-completion. Not so easy to find the right one. Once again be careful because this kept hanging for me on Windows when wrapped in WaitAsynchronousTask. $\endgroup$ Commented Dec 6, 2016 at 13:56
  • 1
    $\begingroup$ Maybe it is worth mentioning that "Content-Length" header has to be present for progress indicator to show progress correctly. It usually is there but happened to me that it wasn't. $\endgroup$ Commented Dec 6, 2016 at 13:56

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.