I’m facing a problem with an Internet application I’m working on right now (programming in C#).
I have to create a report and then send it via email to a certain user. After I create the report, I save it first into a temporary file, then attached it to the email giving the file path.
It’s working on my computer because I have the administrator right, but it doesn’t for my coworkers who don’t have the admin right on their computer.
The file path I’m using is:
string filePath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.InternetCache),
fileName
);
Is there any temporary repository I can use that doesn’t require admin rights?
Thanks.
If you’re using the built in mail classes in .Net, there’s really no reason you need to write the attachment to a file at all, unless whatever is generating the report requires it.
This would work, assuming your report generator doesn’t require file output and can just return bytes.