Using REST API, is there a way we can upload a file to SharePoint and also create the folder to which file to be uploaded. Say for example here “/testfolder” does not exist already in SharePoint and we need to create the folder at the time of uploading the file.
https://mysite.sharepoint.com/sites/sitename/_api/web/GetFolderByServerRelativeUrl(@folderurl)/Files/add(url=@filename)?@folderurl='/sites/sitename/foldername/testfolder'&@filename='sn_test_01.txt'
Thank you.