Skip to content

convertImageToBase64

Picture turn 'base64'

API

Return

argumentInstructionstype
successWhether the conversion is successfulboolean
dataThe value after successful conversionstring,ArrayBuffer , null
messageThe reasons why the conversion succeeds or failsstring

Options

argumentInstructionstypeDefault value
fileIncoming fileFilenull

Example

js
import { convertImageToBase64 } from 'ranuts';

convertImageToBase64(file).then((res) => {
  console.log(result);
});

Released under the MIT License.