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");

1 Answer 1

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.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.