Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storing Multipart File #764

Open
brenthmiras opened this issue Jan 28, 2022 · 0 comments
Open

Storing Multipart File #764

brenthmiras opened this issue Jan 28, 2022 · 0 comments

Comments

@brenthmiras
Copy link

First of all, thanks for this awesome Library.
I'm trying to store a File from an <input type="file" /> using this Model:
`

export default class MyFile extends Model {
  static fields() {
    return {
      id: this.attr(null),
      uploading: this.attr(true),
      progress: this.attr(0),
      file: this.attr(),
    };
  }
}

`

Now, when I try to insert this:

  {
    file: new File(...),
  }
// Not really using constructor as the file is from `<input />` tag
// But it is instanceof File

I get empty object on file key when retrieving using MyFile.all()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant