File Uploads

File upload

Remake can trigger a file upload using a single line of HTML.

<input update:profile-image type="file">

Displaying an uploaded file

To display the file after it's uploaded, you just need to add a couple more lines:

<div object key:profile-image="@search">
  <input update:profile-image type="file">
  <img target:profile-image="@attr:src" src="{{profileImage}}">
</div>

☝️ This is a complete file-upload application.

  • If you added this to app/pages/app-index.hbs, you'd have an app where your users could upload and share a single file at a time.

What Remake does

Remake takes care of:

  1. Uploading the file to a user directory
  2. Showing the file's upload progress
  3. Sending the file's final path back to you

You just have to do two steps:

  1. Create the file <input> element
  2. Tell Remake where to insert the file after it's done uploading

That's it! File uploading is finally easy! 🎉

View on GitHub
☰ Menu