Getting link of uploaded file in List/Library control

Hello.

How can we obtain the direct link to the file when files are uploaded into the "Uploaded Documents Library" using the list/library control and update a hyperlink field in their called "File Link" once the file has been uploaded?

Thanks
stormanh

Hello @stormanh,

You can update the metadata of uploaded documents using PnPjs library. Please find the example here.

The direct link to the document would be:
https://{Domain Name}.sharepoint.com/sites/{Site Name}/{Sub-Site Name}/{Document Library Name}/{Document Name with extension}

For instance:
https://contoso.sharepoint.com/sites/Main/Shared%20Documents/newname.pdf

Thanks @mnikitina! So there is no JS property to quickly obtain the link of the uploaded file? We need to assemble it ourselves?

Hello @stormanh,

When uploading a file, the control only returns its ID. You can get other properties like file name and extension using the PnPjs library.