Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blazerroadg/react-native-azure-blob-storage
This package help you to upload file and assets from react native project to your azure blob storage service
https://github.com/blazerroadg/react-native-azure-blob-storage
azure-blob azure-blob-storage blob react-native upload upload-file upload-images
Last synced: about 10 hours ago
JSON representation
This package help you to upload file and assets from react native project to your azure blob storage service
- Host: GitHub
- URL: https://github.com/blazerroadg/react-native-azure-blob-storage
- Owner: blazerroadg
- Created: 2020-06-20T19:15:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-21T12:15:14.000Z (over 4 years ago)
- Last Synced: 2024-04-23T14:43:43.109Z (8 months ago)
- Topics: azure-blob, azure-blob-storage, blob, react-native, upload, upload-file, upload-images
- Language: TypeScript
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-azure-blob-storage-manager
This package help you to upload file and assests from react native project to your azure blob storage service# Install
## Step 1
```bash
npm i react-native-azure-blob-storage-manager --save
```## Step 2 Dependencies
```bash
npm install --save react-native-background-upload
```### iOS
```bash
cd ios
pod install
```# Manual Installation
please follow each dependensy document :- https://github.com/Vydia/react-native-background-upload
## Usage
Import library
```javascript
import { azureblobfetch, initAzureBlob } from 'react-native-azure-blob-storage-manager/azurblobstorage'
import Upload from 'react-native-background-upload'
```init azure blob storage setting
```javascript
constructor(props) {
super(props);
initAzureBlob(
{
storageKey: `${YOUR_BLOB_STORAGE_SECRET_KEY}`,
account: `${YOUR_ACCOUNT_NAME}`,
version: '2018-03-28'
})
....
}
```upload file from cameraroll :
```javascript
uploadAzure = async (assest) => {
const res = await azureblobfetch({
assest: assest,
container: "images" //your countainer name,
filenameprefix: "test" //add before the autogenrated file name,
type: 'Upload'
})
Upload.addListener('progress', res.uploadId, (data) => {
console.log(`Progress: ${data.progress}% `)
})
Upload.addListener('cancelled', res.uploadId, (data) => {
console.log(`Cancelled!`)
})
Upload.addListener('completed', res.uploadId, (data) => {
// data includes responseCode: number and responseBody: Object
console.log(data)
})
console.log(res);}
```