One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
arch2020
5 years agoHelpful | Level 5
sharing url files using iframe
Hi all,
I am trying to access my files, through generating shared url, which I managed to do using python for my website. I am trying to implement an iframe 3d model viewer, which require a certain file with dxf or dwg extension, which typically generated from CAD file. However, when I provide the url and change the dl=1 or use raw=1, as shown below:
https://www.dropbox.com/s/example/skyline.dxf?dl=1
https://www.dropbox.com/s/example/skyline.dxf?raw=1
I also looked at the dropbox documents regarding to embedding files--that didn;t help me much because it uses dropbox to view the files. my iframe require using a certain viewer which only need direct access to the file.
Is there a better way to access and provide a driect link to the file, to view the model?
Thank you for feebacks in advance
- Greg-DB
Dropbox Staff
Using the raw=1 parameter, as documented here, is the right way to get direct access to the file content from a shared link like this. It sounds like that's not working for you though. Are you getting any particular error or unexpected output?
Note that the client will need to be able to follow redirects, so if your viewer doesn't support that, that may be the issue.
Alternatively, if temporary links would work for your use case, you could get temporary direct links (which don't require a redirect or URL parameter modification) by calling /2/files/get_temporary_link, which is available as files_get_temporary_link in the official Dropbox Python SDK.
- arch2020Helpful | Level 5
Many thanks for your prompt response, much appreciated. I tried using the temporary link but with no success, the viewer keep showing me the loading page but the status never change. I guess I have to dig deeper to find out what is not working.
I just noted while using files_get_temporary_link will generate a link with other metadata. Is there a direct method to only retrieve the temporary link as str?
- Greg-DB
Dropbox Staff
No, there isn't another call like that with a string returned directly. You should access the string in the returned GetTemporaryLinkResult.link field. Does accessing that field not work in your environment for some reason?
As for viewing the file itself, you may want to check the JavaScript console for the page where the viewer isn't successfully loading the file, in case there's some helpful error or output there.
About Discuss Dropbox Developer & API
Make connections with other developers804 PostsLatest Activity: 3 days ago
If 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!