file-upload-spfx-library
TypeScript icon, indicating that this package has built-in type declarations

1.0.20 • Public • Published

file-upload-spfx-library

Made with Fluent UI control

NPM JavaScript Style Guide

Install

npm install --save file-upload-spfx-library

Usage


import AttachmentControl,{saveFilesToLibrary,savingFiles,deleteFiles} from 'file-upload-spfx-library';


//To render the upload control
class Example extends Component {
  render() {
    return <AttachmentControl context={this.props.context} existingFiles={this.state.ExistingFile} viewOnlyMode={this.state.IsEditMode} onChange={(file)=>this.onFileChange(file)} onDelete={(file)=>this.onDelete(file)}></AttachmentControl>
  }
}

//to save the file to library/list use helper 
saveFilesToLibraryList(files:any,listName:string,context:any,itemID:number,IsFileAsAttachment:boolean,destinationPath:string).then(()=>{

})


//to store selected file use function like this
private onFileChange = (file)=>{
  this.setState({
    Files:file
  })
}

//to store selected file use function like this
private onDeleteFile = (file)=>{
  this.setState({
    FilesToBeDelete:file
  })
}

License

MIT ©

git remote add origin https://github.com/kmrshubham0/file-upload-spfx-library.git # Sets the new remote for the local repo git add . git commit -m 'Initial Commit' git push -u origin main # Pushes the changes to the remote repository

Readme

Keywords

none

Package Sidebar

Install

npm i file-upload-spfx-library

Weekly Downloads

20

Version

1.0.20

License

MIT

Unpacked Size

74.7 kB

Total Files

11

Last publish

Collaborators

  • kmrshubham0