sp-dev-fx-controls-react icon indicating copy to clipboard operation
sp-dev-fx-controls-react copied to clipboard

FilePicker - best practice for storing files (images) uploaded via SPFX?

Open stevesuk opened this issue 1 year ago • 1 comments

Category

[ ] Enhancement

[ ] Bug

[X] Question

Version

Please specify what version of the library you are using: [3.16.0]

Question

I'm using the FilePicker control in an SPFX to prompt the user to select an image - which will appear in the SharePoint page as part of the same webpart.

One of the FilePicker options is for the user to upload a file - and this is what my question relates to. For a modern SharePoint page - is there a best practice way of saving an image in the correct place? It looks like the built in webparts store their images in a Site Assets/SitePages/.../ folder (but it seems there may need to be some associated management with the sub-folder, which is dependent on the page name, and may even change if the page is renamed?).

Just wondered if there was a library, package or API which deals with saving an uploaded image, filing it in the right place and returning the Url. Or, do I have to come up with my own code for this?

Any guidance would be appreciated! Thanks,.

stevesuk avatar Jan 10 '24 13:01 stevesuk

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Jan 10 '24 13:01 ghost