1.0.0 • Published 8 years ago

pd-spuploadfiles v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

pdspuploadfiles

pd-spuploadfiles is a module to upload files into sharepoint.

The only files it will accept are from the file input of the dom (filelist). This module will upload as many files as you pass it. The max file size support at this time is 2gb. If a user passes a file that is larger than 2gb the process promise will be rejected and the catch block will receive a object with a filesToBig property. The filesToBig property will contain an array of all file names that were to big. You are responsible for displaying the files to big message to the user.

This module depends on 1. pd-spUtil 2. pd-spserverajax 3. axios

pdspuploadfiles.uploadFilesToLibrary(props)

Uploads files to a SharePoint Library.

Kind: static method of pdspuploadfiles

ParamTypeDescription
propsobject
props.originstring
props.urlstringsite relative url
props.folderstringfolder to save file in, ex SharedDocuments/folder1
props.filesfilelistfiles in the file input element to be uploaded
props.itemCreatedCBitemPreProcessingthis call back is called when an item is added to be processed
props.itemUploadProgressCBitemProgressProcessingthis call back is called when the progress event is fired
props.itemCompletedCBitemCompletedProcessingthis call back is called when item is completed

pdspuploadfiles.uploadFilesToList(props)

Uploads files to a list item. Will accept multiple items

Kind: static method of pdspuploadfiles

ParamTypeDescription
propsobject
props.originstring
props.urlstringsite relative url
props.itemIdsArray.<number>array of item ids to upload files to
props.listGUIDstringuse either listGUID or listTitle not both
props.listTitlestring
props.filesfilelistfiles in the file input element to be uploaded
props.itemCreatedCBitemPreProcessingthis call back is called when an item is added to be processed
props.itemUploadProgressCBitemProgressProcessingthis call back is called when the progress event is fired
props.itemCompletedCBitemCompletedProcessingthis call back is called when item is completed

pdspuploadfiles~itemPreProcessing : function

The index and itemData to process will be passed to this function the order number is your id to locate elements (dom or whatever) based on the specific item processing for creating a front end this is where to create the dom element to update with progress data

Kind: inner typedef of pdspuploadfiles

ParamType
itemDataany
indexnumber

pdspuploadfiles~itemProgressProcessing : function

The itemProgressProcessing will be passed the progress number and the index to trigger any side effects Index is your id to locate elements (dom or whatever) based on the specific item processing There is a small gap in time once the 100% is recieved and when the server sends the completed event (fyi)

Kind: inner typedef of pdspuploadfiles

ParamType
percentUploadednumber
indexnumber

pdspuploadfiles~itemCompletedProcessing : function

The processingCompletedCallback will be passed the order number and the process status (success or fail) to trigger any completed side effects The order number is your id to locate elements (dom or whatever) based on the specific item processing This is where you would pass the actions to show item completed uploading

Kind: inner typedef of pdspuploadfiles

ParamType
statusstring
indexnumber