Skip to content

Use same format in Typescript #1

@josauder

Description

@josauder

Hi, I was wondering how to to the same thing in typescript. I get an error with this line:

data.append('photo', {
  uri: photo.uri,
  type: 'image/jpeg', 
  name: 'testPhotoName'
});

Because of a type mismatch:

Argument of type '{ uri: string; name: string; type: string; }' is not assignable to parameter of type 'string | Blob'.
  Object literal may only specify known properties, and 'uri' does not exist in type 'string | Blob'.

The documentation of FormData.append looks nothing like the code described above. Does anybody have an idea how to solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions