# Download command does not follow redirects on Windows

**URL:** <https://discourse.julialang.org/t/download-command-does-not-follow-redirects-on-windows/485>\
**Category:** General Usage\
**Created:** [November 21, 2016, 10:45pm UTC](https://discourse.julialang.org/t/download-command-does-not-follow-redirects-on-windows/485 "2016-11-21T22:45:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eftekhari](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eftekhari/32/37053_2.png) [@eftekhari](https://discourse.julialang.org/u/eftekhari)\
**Post date:** [November 21, 2016, 10:45pm UTC](https://discourse.julialang.org/t/download-command-does-not-follow-redirects-on-windows/485/1 "2016-11-21T22:45:49Z")

</div>

I have a package that needs to download a library from sourceforge. On windows, the download command does not follow redirects. I found that the microsoft function that is used by Julia is not able to follow redirects. Is there any other ways to download from sourceforge on windows?  
Here’s the code that works on Linux, but not on windows:

```julia
download("https://sourceforge.net/projects/coolprop/files/CoolProp/6.1.0/shared_library/Windows/64bit/libCoolProp.dll/download", "libcoolprop.dll")

```

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [November 22, 2016, 1:43pm UTC](https://discourse.julialang.org/t/download-command-does-not-follow-redirects-on-windows/485/2 "2016-11-22T13:43:56Z")

</div>

Can you get `curl` for Windows? I think that can do redirects. I think I had to use `curl` for my [PhilipsHue](https://github.com/cormullion/PhilipsHue.jl) hack.

---

<div class="post-metadata">

**Author:** ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)\
**Post date:** [November 22, 2016, 3:57pm UTC](https://discourse.julialang.org/t/download-command-does-not-follow-redirects-on-windows/485/3 "2016-11-22T15:57:17Z")

</div>

I think it’s generally agreed that we need to improve the `download` implementation on Windows, but nobody has done the work yet. See this link (and linked URLs): [https://github.com/JuliaPackaging/WinRPM.jl/issues/40](https://github.com/JuliaPackaging/WinRPM.jl/issues/40)

---

<div class="post-metadata">

**Author:** ![eftekhari](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eftekhari/32/37053_2.png) [@eftekhari](https://discourse.julialang.org/u/eftekhari)\
**Post date:** [November 22, 2016, 5:39pm UTC](https://discourse.julialang.org/t/download-command-does-not-follow-redirects-on-windows/485/4 "2016-11-22T17:39:08Z")

</div>

Thank you for your help. I use `curl` until a better solution is found.

```julia
readall(`curl -L -o libcoolprop.dll https://sourceforge.net/projects/coolprop/files/CoolProp/6.1.0/shared_library/Windows/64bit/libCoolProp.dll`)

```

---

<div class="post-metadata">

**Author:** ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)\
**Post date:** [November 23, 2016, 3:50am UTC](https://discourse.julialang.org/t/download-command-does-not-follow-redirects-on-windows/485/5 "2016-11-23T03:50:13Z")

</div>

Note that it’s a lot less likely for a curl executable to be installed and on the path for users on Windows, so this will not be very reliable. You can try BinDeps.download\_cmd which uses powershell, which is always installed on Windows.

---

<div class="post-metadata">

**Author:** ![eftekhari](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eftekhari/32/37053_2.png) [@eftekhari](https://discourse.julialang.org/u/eftekhari)\
**Post date:** [November 23, 2016, 7:58am UTC](https://discourse.julialang.org/t/download-command-does-not-follow-redirects-on-windows/485/6 "2016-11-23T07:58:24Z")

</div>

Thank you Tony. You are right. The `curl` command did not work on my windows machine. Now I use the following and it works fine:

```julia
lib_coolprop_path=joinpath(Pkg.dir(), "CoolProp", "deps", "libCoolProp.dll")
lib_coolprop_win_url="https://sourceforge.net/projects/coolprop/files/CoolProp/6.1.0/shared_library/Windows/64bit/libCoolProp.dll/download"
readall(BinDeps.download_cmd(lib_coolprop_win_url, lib_coolprop_path))

```
