I am using the following code to upload files in share point folders.
Dim lobjSourceFileCreateInfo As New FileCreationInformation()
lobjSourceFileCreateInfo.Content = System.IO.File.ReadAllBytes(lstrSourceFilePath)
lobjSourceFileCreateInfo.Overwrite = True
lobjSourceFileCreateInfo.Url = lstrFileRelativeURL
Dim lobjWebObj As Web = lobjClientContext.Web
Dim llstListOfDoc As List = lobjWebObj.Lists.GetByTitle(pstrListName)
Dim lobjFiletoBeUploaded As MSSPClient.File = llstListOfDoc.RootFolder.Files.Add(lobjSourceFileCreateInfo)
lobjClientContext.Load(lobjFiletoBeUploaded)
lobjClientContext.ExecuteQuery()
But I am getting the following error: Value does not fall within specified range. However I could able to upload files directly under the document library but not in the folders created under the document library.