Click here to Skip to main content
15,891,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,
i have a problem with this line of code in office 365, it throws 'access to 'directory' denied' exception
using (FileStream imageStream = new FileStream("myfile.jpg", FileMode.Create))
{ //some process }
i have googled but didn't find the exact solution yet, Any one can help me ?
Posted

1 solution

I think the error message makes it pretty obvious what's wrong. You don't have permissions to create that file in whatever folder you're trying to write it in.

So, what folder are you trying to create the file in?
 
Share this answer
 
Comments
[no name] 24-May-14 17:22pm    
Short and clear and 5
eman ashraf 24-May-14 17:24pm    
i will perform some operation on filestream then pass this stream to filecreationinformation to add it to list
i have used memorystream to create the stream then process, but the image have not generated successfully

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900