Use Webflow CMS for managing custom url of attachament

Published:

Category:

Tools

For many of my clients is necessary to share their files from the direct url based on their direct name instead of some other naming like upload.webflow etc. It was crucial in some cases to allow sharing the custom url for the donwloading of the files. So I have made a small workaround using Webflow CMS for customizing the URLs. So you will use nameurl.com/docs/file instead of uploads-ssl.webflow.com/filename.

Here is the Webflow CMS attachement workaround

1. Set-up CMS collection for pasting the docs

Name the collection as you need like: "docs, assets, documents etc.". Add only required field: attachaments for uploading your files.

2.Put small custom code into embed code in your collection page

The custom code will start downloading of your attachament automatically when page is load.

<div onload="download()"></div><a id="dl" style="display: none" href="add your attachament field from collection here" download>Download</a><script> (function download() { document.getElementById('dl').click(); })() </script>

3. Design your CMS collection page as "Thanks for downloading page"

This step might be crucial for your customers as the downloading starts automatically. Let them knows what has happened on the page. Add the button to move them back on your homepage or list of your docs.

4.Add files to your docs collection

Last part is to add all unnecessary attachaments to your collection :-)

Tags that may be worth your interest:

 Leave me feedback or follow me on Twitter @BilekUI to stay updated!

Petr Bilek - Visual Designer. Small Avatar for Social Media.

Join me on Twitter
and stay in touch.