pd-spuploadfiles
v1.0.0
Published
<a name="module_pdspuploadfiles"></a>
Downloads
2
Readme
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
- pd-spUtil
- pd-spserverajax
- axios
- pdspuploadfiles
- static
- inner
- ~itemPreProcessing : function
- ~itemProgressProcessing : function
- ~itemCompletedProcessing : function
pdspuploadfiles.uploadFilesToLibrary(props)
Uploads files to a SharePoint Library.
Kind: static method of pdspuploadfiles
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.folder | string | folder to save file in, ex SharedDocuments/folder1 | | props.files | filelist | files in the file input element to be uploaded | | [props.itemCreatedCB] | itemPreProcessing | this call back is called when an item is added to be processed | | [props.itemUploadProgressCB] | itemProgressProcessing | this call back is called when the progress event is fired | | [props.itemCompletedCB] | itemCompletedProcessing | this 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
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.itemIds | Array.<number> | array of item ids to upload files to | | props.listGUID | string | use either listGUID or listTitle not both | | [props.listTitle] | string | | | props.files | filelist | files in the file input element to be uploaded | | [props.itemCreatedCB] | itemPreProcessing | this call back is called when an item is added to be processed | | [props.itemUploadProgressCB] | itemProgressProcessing | this call back is called when the progress event is fired | | [props.itemCompletedCB] | itemCompletedProcessing | this 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
| Param | Type | | --- | --- | | itemData | any | | index | number |
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
| Param | Type | | --- | --- | | percentUploaded | number | | index | number |
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
| Param | Type | | --- | --- | | status | string | | index | number |