How to download a file from box using wget?

Viewed 18646

I've created a direct link to a file in box:

enter image description here

The previous link is to the browser web interface, so I've then shared with a direct link:

enter image description here

However, if I download the file with a wget I receive garbage.

How can I download the file with wget?

3 Answers

I was able to download the file by making the link public, then replacing /s/ in the url with /shared/static

So my final command was:

curl -L  https://MYUNI.box.com/shared/static/EXAMPLEtzwosac6pz --output myfile.zip

This can probably be modified for wget.

I might be a bit late to the party, but FWIW:
I tried to do the same things in order to download a folder.
I went to the box UI and opened the browser's network tab on the developer tools. Then I clicked on download and copied as cURL the first link generated, it was something like (removed many headers and options for readability)

curl 'https://app.box.com/index.php?folder_id=122215143745&rm=box_v2_zip_folder'

The response of this request is a json object containing a link for downloading the folder:

{
  "use_zpdl": "true",
  "result": "success",
  "download_url": <somg long url>,
  "progress_reporting_url": <some other url>
}

I then executed wget -L <download_url> and was able to download the file using wget

Related