How to download file from dropbox using e.g. websave?

조회 수: 9 (최근 30일)
Jakob Sievers
Jakob Sievers 2018년 1월 24일
댓글: Rik 2018년 1월 24일
Hi there
How does one download a shared file (public visibility) from dropbox? I used to use the following code to achieve the task, but I suspect that dropbox has changed something because now it doesnt work as before:
outfilename = websave(filename,'https://www.dropbox.com/s/y0v5z3rtbw15kwb/OOT_Example_data_DONOTDELETE.zip?dl=0');
where the file "https://www.dropbox.com/s/y0v5z3rtbw15kwb/OOT_Example_data_DONOTDELETE.zip?dl=0" is a 43mb zip file. From matlab it downloads only 330kb of the file but in a webbrowser it downloads the whole thing. Can anyone help me?
Thanks in advance!
Cheers
Jakob

채택된 답변

Rik
Rik 2018년 1월 24일
For me using ?dl=1 instead of ?dl=0 did the trick.
  댓글 수: 2
Jakob Sievers
Jakob Sievers 2018년 1월 24일
That's curious, but it sure does fix the problem. Thank you so much for your help!
Rik
Rik 2018년 1월 24일
If you try both links in a browser, you can see that dl=1 activates the download immediately, while dl=0 shows you a page that asks for confirmation. Which Matlab can then dutifully write to a nonsense file of 300 kb.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Downloads에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by