The Community is undergoing a major upgrade. Find out more, ask us questions or share your thoughts here.
Forum Discussion
colehurwitz
6 years agoNew member | Level 2
Downloading .h5 file with urllib
Hello,
I recently uploaded a 4gb .h5 file onto dropbox under this url:
https://www.dropbox.com/s/1jolgsw5kgxmsd5/recordings_300_SqMEA-10-15um_minamp0_60s_10uV_far-neurons_bpf_25-03-2019.h5?dl=0
When I try to download it using urllib in python 3:
file_name = 'recordings_300_SqMEA-10-15um_minamp0_60s_10uV_far- neurons_bpf_25-03-2019.h5'
urllib.request.urlretrieve(file_url, file_name)
It downloads a 226K file that can't be parsed. Any idea what the issue might be or what I am doing wrong here? I can download the file normally by pressing the download button on the dropbox page.
Best regards,
Cole Hurwitz
That URL is actually for a preview web page for the file, not the file data itself. (The short file you're getting back is probably the HTML page itself.)
You can modify these shared links for direct file access if you need though. You can find information on doing so here:
- Greg-DBDropbox Staff
That URL is actually for a preview web page for the file, not the file data itself. (The short file you're getting back is probably the HTML page itself.)
You can modify these shared links for direct file access if you need though. You can find information on doing so here:
- colehurwitzNew member | Level 2
Thanks so much! This worked.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,875 PostsLatest Activity: 2 hours agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!