I want to check if a file exists in the same URL but not on the server. What I meant was, say if I have a domain https://example.com/ and a folder in the domain https://example.com**/s3files/** automatically points or redirect to S3 so that https://example.com/**s3files/test.png**, downloads a file from s3 directly.
How can I test in my controller that said file exists?
I'm trying to do something like this
fileName = $"/s3files/{fileName}";
if (!File.Exists(path))
return "/assets/images/no-image.png";
return fileName;
But I'm not sure if It's correct since File.Exist
checks the local directory of the server if the file exists in the '/s3files' subdirectory.
Since my controller doesn't know about the routing part and its current domain URL, how can I check if the file exists?
Maybe this will help...