Starting over RRS feed

  • Question

  • User-1319281071 posted
    Ive had alot of difficulty with something that seems too simple for that much hassle. I must be missing something so can someone post some sample code that 1) generates a JPG bitmap from scratch of an arbitrary size and 2) saves the image to a folder on the server Im getting that generic GDI+ error, and was told it was a security issue. Im pretty sure its not, or at least asp.net has write access to the folder so... can someone post a code example to do this?
    Thursday, November 11, 2004 6:45 PM

All replies

  • User-1372641848 posted
    Try to create file in same folder using System.IO.File.Create if it creates file then your application has correct permission.. put following code in your aspx file and change path of file in code to your path. using(System.IO.FileStream fs = System.IO.File.Create("c:\\test.htm")){ byte[] data = (new System.Text.UTF7Encoding()).GetBytes("This is test of creation"); fs.Write(data,0,data.Length); fs.Close(); } and don't forget to tell us what happned.
    Thursday, November 11, 2004 8:52 PM
  • User-1319281071 posted
    I got the image to finally save. Everywhere I looked said to give the computer\ASPNET write permission and that still didnt work. What I ALSO had to do was give user permissions. Oops. It was a security issue after all.
    Friday, November 12, 2004 1:48 PM