36

I have an HTML5 game that I would like anyone on the internet to be able to access. However, when I give a link to the page, it just prompts to download the file instead of rendering it.

How do I serve webpages from dropbox?

MxLDevs
  • 1,179
  • 4
  • 16
  • 28

8 Answers8

31

It was great while it lasted, folks. Dropbox has ended support for serving HTML files as of today for Basic users.

Dropbox Basic (free) users: Beginning October 3, 2016, you can no longer use shared links to render HTML content in a web browser. If you created a website that directly displays HTML content from your Dropbox, it will no longer render in the browser. The HTML content itself will still remain in your Dropbox and can be shared.

Dropbox Pro and Business users: Beginning September 1, 2017, you can no longer render HTML content.

from https://www.dropbox.com/help/16

bmauter
  • 468
  • 4
  • 7
  • 1
    Damn!!!! :-\ That's the reason my pages are now downloading instead of showing... – marcolopes Oct 07 '16 at 05:28
  • Just found this out the hard way too. Thanks for the advance notice, Dropbox. Not. – TonyG Oct 14 '16 at 20:41
  • 1
    **X**HTML files seem to still work, and if your HTML source is well formed, it's trivial to make it XHTML. – typo Dec 01 '16 at 03:26
  • @typo, I'm not seeing that. I created a super-basic XHTML file and put it on my dropbox. I shared the file and modified the link like Jimmy Ng said and it downloads for me. Are you sure you're not on a Pro or Business account? – bmauter Dec 07 '16 at 14:47
  • @bmauter No, just a regular free account. Here, try [this link](https://dl.dropboxusercontent.com/u/11379791/Dropbox%20XHTML%20test.xhtml); works for me in incognito mode and on my phone. – typo Dec 08 '16 at 22:01
  • You can use "github pages" instead, a free static web pages serving with version control. – aeroson Mar 17 '17 at 09:55
  • @typo Thanks for the xhtml tip! It worked perfectly for me. – Brian Rothstein Apr 10 '17 at 01:59
  • @BrianRothstein, @bmauter, just a heads-up: normal XHTML links don't work anymore, but you can still use them if you append `?raw=1` to them (e.g., https://www.dropbox.com/s/m4hvv6ynvkti7e7/Dropbox%20XHTML%20test.xhtml?raw=1). – typo Sep 20 '17 at 04:15
  • @typo Thanks for the heads up. Also, It seems that dl.dropbox.com (which is what I use for my links) still works normally. (e.g. https://dl.dropboxusercontent.com/s/m4hvv6ynvkti7e7/Dropbox%20XHTML%20test.xhtml ) – Brian Rothstein Sep 20 '17 at 22:31
31

I believe you can modify your file's 'shared' dropbox link to serve HTML from DB directly.

  1. Upload your html file to dropbox and click the file's 'Share' link:

    enter image description here

  2. Copy the "Link to file"

    enter image description here

  3. Modify the link by replacing 'www.dropbox.com' with 'dl.dropboxusercontent.com'

    Before

    https://www.dropbox.com/s/s8ffr2v08jc2f7d/fakeHTMLpage.html?dl=0
    

    After

    https://dl.dropboxusercontent.com/s/s8ffr2v08jc2f7d/fakeHTMLpage.html?dl=0
    
  4. Try it!

I'd love feedback if this worked for you guys!

Pablo A
  • 1,470
  • 13
  • 21
Jimmy Ng
  • 411
  • 1
  • 4
  • 3
  • 4
    I have tried it, but it fails to load external files stored in the same folder. This is because all of the other files have their own hashed links. This probably works if everything is contained in a single file though. – MxLDevs Jun 23 '15 at 15:21
  • Confirmed single .html file works well. I just wanted to get some HTML reports hosted somewhere and being able to delete it at some point, so using dropbox was pretty convenient. – angularsen Sep 23 '16 at 09:22
  • 1
    Does this still work for anyone? When I visit a link like that, my browser (Chrome) forces a download of the HTML file, i/o rendering it. – Protector one Dec 20 '16 at 15:24
  • Works perfectly - THANK YOU. After changing the public folder to shared links, I lost all my content. But ATTENTION: you must have to delete the end of the link: ?dl=0 – Minas Petterson Mar 28 '17 at 17:55
11

The file must be in your Public folder in order to be rendered as HTML, it can't just be a shared link.

NB: Accounts created after October 4, 2012 do not have a Public folder unless you upgrade to a Pro account.

heavyd
  • 62,847
  • 18
  • 155
  • 177
  • 3
    It's worth pointing out that you should NOT use the "Share > Link to file" feature for this to work but, instead, right click the file and use the "Copy public link..." one. (On the Web; have not tested on laptop.) – Fabien Snauwaert Nov 19 '14 at 10:19
  • Thank you so much for the comment, you just saved my wife's night. :D – dlanod Jan 10 '15 at 10:05
  • Following up on @FabienSnauwaert's comment, at least on Mac OS X, right-clicking the file in the file system and selecting "Copy Public Link" does the right thing: you get a useful link to the document. – Dave Land Mar 10 '15 at 03:11
  • 4
    It seems this feature is being discontinued. I just got an email "We’re writing to let you know that we’ll be discontinuing the ability to render HTML content in-browser via shared links or Public Folder. If you're using Dropbox shared links to host HTML files for a website, the content will no longer display in-browser." – snoram Sep 01 '16 at 18:19
4

As others have said, this is something that you can accomplish by placing the relevant HTML (and JS, CSS, etc.) in the Public folder. However, there is an additional note of which you should be aware: Dropbox Public folders are access limited. If a file generates “An excessive amount of traffic”, the link will be suspended (permanently, for repeat offenses). That link is a little out-of-date as I cannot find a newer link which gives specific numbers for the limit. If the information is still correct, then a little web traffic should certainly not be a problem, but for a site that will serve a large amount of content, you may find the bandwidth restriction on a free account to be a bit stifling:

Excerpt from link above:

According to Dropbox support, public links for free accounts may not use more than 10GB of bandwidth per day while that limit is 250GB per day for paid Dropbox accounts. The links are automatically suspended if any of your files exceed that limit.

HalosGhost
  • 357
  • 1
  • 10
3

There is a lot of stand alone services, to return as lost dropbox functionality. For example:

  • kissr.com
orschiro
  • 3,447
  • 9
  • 28
  • 35
2

Simple web pages should be accessible direct from Dropbox via the Dropbox web pages. However, you are limited to simple HTML and client-side JavaScript only, no PHP or other server-side code.

I've just tested it on my own Dropbox and it worked fine.

Julian Knight
  • 14,313
  • 3
  • 27
  • 41
0

Here's the reason why it doesn't work:

"There were some Russian IP addresses blocked from hosting html files because of abuse."

GrayFace
  • 162
  • 1
  • 6
0

Regarding the post above that read It's worth pointing out that you should NOT use the "Share > Link to file" feature for this to work but, instead, right click the file and use the "Copy public link..." one. (On the Web; have not tested on laptop.) –

I tried this and it works from Safari, but includes the white banner across the top of the page with items to click to close, share, etc. Before of course it just rendered as a simple html page with nothing added.

However, it does not work from a browser called Lightning. That one is crashy but quick; I often use it because Safari becomes unresponsive with too many pages/windows open. Lightning now requires that I download the html file. Interestingly though, the original shared public link displayed correctly as always in Lightning, when Safari prompted to download the html file. So now it is switched. Dropbox has really dropped the ball.

Steve
  • 1