Sharing

Embedding a file on your own site

A direct URL to one file that any web page can load, with no expiry and no download page in the way, and a way to put a whole HTML page online.

On this page

An embed link points at the file itself rather than at a download page, so a browser on somebody else's website can load it directly. It is what you want for a logo on a landing page, an image in a newsletter, or an asset your developer needs a stable URL for.

Embeds are on Pro, Max and Business. That is not an arbitrary gate: an embed is created with no expiry, and a link with no expiry is itself a paid-plan setting.

Making one#

  1. 1

    Select exactly one file

    No multi-select. An embed points at a single file by design. Some accounts can also select a single folder instead, which is how you publish an HTML page that has its own stylesheet and scripts: see the section below.

  2. 2

    Press Share, then the Embed tab

    At the top of the share panel, beside Share.

  3. 3

    Press Create embed

    You get a URL of the form nemilab.com/embed/<link id>/<file id>. Copy it.

Putting it on a page
<img src="https://nemilab.com/embed/your-link-id/your-file-id" alt="Studio logo">

The URL is just a URL: it works in an <img> tag, as a CSS background, in a <video> source, or anywhere else a web page can reference a file. Nemi answers it with the file itself and allows any site to load it, so you do not have to list your domains anywhere.

Putting an HTML page online#

An embed of an .html file is served as a page, not as a file to save, so opening the link shows the page and putting the link in an <iframe> shows it inside your own site. Its CSS and its JavaScript run.

A page is rarely one file, so this is where embedding a folder comes in. Share the folder that holds the site and Nemi serves it as a small website: index.html at the root of the link is the home page, and every relative link in it, style.css, assets/app.js, images/logo.png, a link to another page, resolves against the other files in that same folder. Nothing outside the folder you picked is reachable, so the folder is the boundary.

A hosted page inside your own site
<iframe src="https://nemilab.com/embed/your-link-id" title="Our menu" width="100%" height="600"></iframe>

What a hosted page can and cannot do#

Your page runs in a sandbox, because it is served from nemilab.com and we will not let a file anyone uploads act as if it were Nemi. Almost everything a page normally does still works, and a few things do not.

  • Works: HTML, CSS, images, fonts, video and audio, JavaScript including modules, canvas and WebGL, fetching data from other sites, forms, and links that open in a new tab.
  • Does not work: cookies, localStorage and sessionStorage, which are all unavailable, so anything that tries to remember a visitor between page loads will fail.
  • Does not work: changing the address bar with the History API, which is what most single-page routers use. Routing based on the part of the URL after a # works fine.
  • Does not work: replacing the page that framed you. A hosted page cannot navigate the site it is embedded in.

What an embed will not serve#

  • Executables and scripts are refused outright, whatever the link says. That includes .exe, .dmg, .apk, .sh, .bat, .jar and their relatives.
  • A file that our virus scan has flagged, or has not finished checking, is not served either. A brand new upload can therefore take a moment before its embed works.
  • Requests are rate limited per visitor, so one page hammering the URL is throttled rather than billed to you.
  • Search engines are asked not to index embed URLs, so a page hosted this way will not turn up in search results.

Managing embeds#

They live in their own tab in the link manager (⌘⇧L), separate from ordinary share links, and each card shows how many copies have been served. Deleting an embed stops it everywhere at once, which will leave a gap on any page still using it, so search your site before you delete.

Can I swap the file behind an embed?

For a file embed, no: the URL names a specific file, so to replace an image you create a new embed and change the URL on your site. A folder embed is different, because the URL names the folder. Replace index.html in it and the link serves the new page.

Is this a website host?

It is enough for a page: a menu, a one-pager, a report, an interactive demo. It is not a place to run a shop or anything that has to remember who a visitor is, because the sandbox has no storage and no cookies, and the URL is a link id rather than your own domain.

Does an embed need a password?

It should not have one. A browser loading an image cannot answer a password prompt, so a password would simply break it.

Do embed views count towards anything?

They are counted as opens on that link, and the bytes come out of your account the same way any download does.

Related

Still stuck? Email support@nemilab.com and tell us what you were trying to do.