I am uploading a file to a container and it's work perfectly. but I want to upload a file to a nested particular directory.
So how can I do that with c#?
You can do it this way:
DataLakeDirectoryClient directoryClient =
fileSystemClient.GetDirectoryClient("my-directory/my-subdirectory");
DataLakeFileClient fileClient = await directoryClient.CreateFileAsync("uploaded-file.txt");
FileStream fileStream =
File.OpenRead("C:\\Users\\contoso\\Temp\\file-to-upload.txt");
long fileSize = fileStream.Length;
await fileClient.AppendAsync(fileStream, offset: 0);
await fileClient.FlushAsync(position: fileSize);