I want to take an Image from user then store in List using the sp PNP API, then retrieve from the list and display to user by using the get API call from sp PNP
Loading
I want to take an Image from user then store in List using the sp PNP API, then retrieve from the list and display to user by using the get API call from sp PNP
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tuhin PaulPosted Apr 23, 2023, 1:00 PM
The SharePoint Framework (SPFx) is a development model for building SharePoint solutions that focuses on client-side development using modern web technologies such as React, TypeScript, and Node.js. In order to interact with SharePoint from a client-side solution, developers typically use SharePoint's REST API or a library that simplifies the process of working with the API. One such library is the PnP JS library, which is a collection of JavaScript functions and helpers that make it easier to interact with SharePoint from client-side solutions. The library provides a number of helper functions for common tasks, such as working with lists and libraries, managing site permissions, and working with user profiles. To use the PnP JS library, you must first authenticate with SharePoint. There are several ways to authenticate with SharePoint, including using OAuth or Azure Active Directory. The specific method you use will depend on the requirements of your solution and the resources available to you.
Once you've authenticated with SharePoint, you can use the PnP JS library to interact with SharePoint lists. In the code snippets provided in the previous answer, we're using the library to add an image to a SharePoint list and then retrieve that image and display it to the user.
Tuhin PaulPosted Apr 23, 2023, 1:00 PM
Part 2
And below is the code to retrieve the image from the SharePoint list and display it to the user:
Tuhin PaulPosted Apr 23, 2023, 12:56 PM
Part 1
First create a SharePoint list with a column of type 'Image' to store the images. Next use the PnP JS library to upload the image to the SharePoint list. and then use the PnP JS library to retrieve the image from the SharePoint list and display it to the user. See the code to upload an image on sharepoint list: