Hi Ravichandran,
Using File Picker control, can we upload multiple files at a time? I am using SPFX react framework and trying to select multiple files at a time and attach it to SharePoint list item on item creation. Please suggest how we can do this.
Thanks,
Lalitha
Do you know what the difference between the onChange and onSave properties is? According to the documentation, onChange is fired off ‘…when the file selection has been changed.’ and onSave is fired off ‘..when the file has been selected and picker has been closed.
I’m trying to construct an example where one of the event handlers does not fire off when the other does. So far, simply selecting a new file in the picker does nothing, but once I hit ‘Insert’, both events fire off.
Thank you for sharing this guide. How can I modify this code so that it only allows file upload from a local drive to the document library.
LikeLike
Hi Samuel,
You have to set “hideLinkUploadTab” is true, like below. so this will hide the custom upload option
LikeLiked by 1 person
Hi Ravichandran,
Using File Picker control, can we upload multiple files at a time? I am using SPFX react framework and trying to select multiple files at a time and attach it to SharePoint list item on item creation. Please suggest how we can do this.
Thanks,
Lalitha
LikeLiked by 1 person
Hi Lalitha,
Try this control for list item attachment
https://ravichandran.blog/2020/05/21/pnp-listitem-attachments-control-in-the-sharepoint-framework-spfx-web-part/
LikeLiked by 1 person
Do you know what the difference between the onChange and onSave properties is? According to the documentation, onChange is fired off ‘…when the file selection has been changed.’ and onSave is fired off ‘..when the file has been selected and picker has been closed.
I’m trying to construct an example where one of the event handlers does not fire off when the other does. So far, simply selecting a new file in the picker does nothing, but once I hit ‘Insert’, both events fire off.
Cheers!
Chas
LikeLiked by 1 person
Using this IF condition you can find out what is going on in the file picker
private async pickerevent(file: IFilePickerResult) {
if (file.fileAbsoluteUrl == null) {
//new file uploaded in the picker
}
else {
//file selected from picker
}
}
https://github.com/ravichandran-blog/SPFx/blob/master/spfx-pnp-filepicker/src/webparts/spfxPnpFilepicker/components/SpfxPnpFilepicker.tsx#L45
LikeLiked by 1 person
Folder is hardcoded, is there option chose folder and upload?
LikeLike
You can use PnP Folder Picker Control
https://pnp.github.io/sp-dev-fx-controls-react/controls/FolderPicker/
LikeLike