Skip to main content
Version: 2.1.4

pushFile

3p-core v2.1.4


3p-core / pushFile

Function: pushFile()

pushFile(sp, context, listName, itemId, file, fieldName): Promise<string>

Uploads an image to SharePoint using the UploadImage REST API.

Parameters

sp

SPFI

The SPFI instance for list retrieval.

context

any

The SPFx web part context.

listName

string

The name of the target SharePoint list.

itemId

number

The ID of the list item to update.

file

File

The image file to upload.

fieldName

string

The internal field name for the image column.

Returns

Promise<string>

A stringified object representing the new image field value.

Example

pushFile(sp, context, listName, itemId, file, fieldName)