Downloads directory location

I am confused about where files end up when I download them with Downloads.jl. Unfortunately there are no examples in the documentation to follow, so it’s hard to know what I’m doing wrong.

Here’s my attempt at downloading a 1 MB file:

using Downloads
my_file = ""

After running the code above, I am expecting to find the downloaded file in my current directory, but it’s not there. When I run the code above, it prints this line:


which might suggest that Downloads put the file in a folder called /var/folders..., but I can’t find that directory on my computer.

The Downloads.jl documentation suggests that something like this might place the file in the current directory:,output=pwd())

but the line above produces this error:

ERROR: MethodError: no method matching download(::String, ::Nothing; output="/Users/cgreene/Documents/MATLAB/data_testing")

I also found this thread, which suggests the target location might be entered as the second argument to the downloads function like this:,pwd())

but the above produces this error:

ERROR: IOError: rm("/Users/cgreene/Documents/MATLAB/data_testing"): directory not empty (ENOTEMPTY)

Does anyone know where files go when they’re downloaded by And is there a way to specify the target location?

I think you should try providing a filename instead of a directory.

1 Like

That’s because the output argument is a positional argument, not a keyword argument (see the documentation). These are not the same in Julia, unlike Python. Also, the output argument is a filename, not a directory. Try:, basename(my_file))
1 Like

:person_facepalming: Thanks @GunnarFarneback.

Success! Here’s the working solution:

using Downloads
file_url = ""
target_directory = "/Users/cgreene/Documents/MATLAB/data_testing";
target_file = target_directory * "/" * basename(file_url),target_file)

Thanks @stevengj!

1 Like

Still waiting for this to be merged so you don’t have to do the extension back yourself

1 Like