Skip to content

nnnnnoel/react-native-image-to-blob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-image-to-blob

platforms npm npm github issues github closed issues Issue Stats

It can get blob from react native image uri.

That universal links can't get blob

  • rct-image-store
  • asset-library

Getting Started

npm install --save react-native-image-to-blob react-native-image-resizer
cd ios && pod install

Usage

// ImageType is from react-native-camera-roll's image return type
async function uploadPhoto(image: ImageType) {
  const imageFile = await imageToBlob(image);

  const formData = new FormData();
  formData.append('imageFile', imageFile);

  await fetch('https://your.server.url/upload/photo', {
    method: 'POST',
    body: formData,
    headers: {
      'Content-Type': 'multipart/form-data;charset=utf-8',
    },
  });
}

About

image to blob library for react-native

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published