0

i tired this one Send FormData with other field in Angular not work out for me.

i need to access the image from file system then send it.

        let fullPath = path.join(folder.path, "1.png");
        const imageFromLocalFile: ImageSource = <ImageSource> fromFile(fullPath);
        const base64String = imageFromLocalFile.toBase64String("png");
iosDev
  • 98
  • 1
  • 7

1 Answers1

0

FormData is not supported by NativeScript. You have 2 options,

  1. Send the image as Base64 string, looks like you already know how to get the Base64 string form image, you may just send it as a param in JOSN body.
  2. Use nativescript-background-http plugin that can directly upload the file.
Manoj
  • 21,753
  • 3
  • 20
  • 41