How to upload a file or photo to an API


i have created the model, route, controller, component and template … everything is working. only that file / image thing isn’t working.

i have search for tutorials but didn’t find any. the documentation of ember-file-upload and of dropzonejs helps me not.

what I need is a very simple example what is working, to understand how it is working.

any links / tutorials / examples ???

that is my controller:

import Controller from ‘@ember/controller’;

import { inject as service } from ‘@ember/service’;

import ProjectImageValidations from ‘…/…/…/validations/project-image’;

export default Controller.extend({ store: service(),


actions: { save(changeset) { let { project } = this; let image =‘project-image’, changeset.get(‘change’)); image.set(‘project’, project);

    .then(() => {
      this.transitionToRoute('project.image.index',, );
    .catch((error) => {
      alert(`Project-LFZ Foto couldn't be saved: ${error}`);

} });