@supahoops
You can use any path for the fileCacheSubFolder
variable, so let’s take this two lines of code
var fileFolderName = Path.GetFileName(documentGuid).Replace(".", "_");
string fileCacheSubFolder = Path.Combine(cachePath, fileFolderName);
The first line is responsible for creating unique relative folder path e.g. teacher_docx
for a file and the second one is responsible for combining base cache path with relative cache path e.g. .\cache\teacher_docx
. You can build unique cache folder path by adding username or user ID e.g. .\cache\{userID or username}\teacher_docx
. The final code will be something like this
var userId = GetUserId();
var fileFolderName = Path.GetFileName(documentGuid).Replace(".", "_");
string fileCacheSubFolder = Path.Combine(cachePath, userId, fileFolderName);
At this point, we know how to create a unique folder path per user and file but we don’t have a user. How do you plan to authenticate users in your app?