image save in server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jayasabari
    New Member
    • Sep 2007
    • 25

    image save in server

    hai,
    i am saving the image in server by using response.saveas ("path name") in .net. The image is saving but preview is not available. please can you give any suggestion.

    With Regards,
    K.Jayasabari
  • jayasabari
    New Member
    • Sep 2007
    • 25

    #2
    save images to server

    hai,
    I am saving the images to the server by using response.saveas ("path name"). The images is saving the located path but the preview is not there. I am using in .net. please can you give any suggestion.

    With regards,
    k.Jayasabari.

    Comment

    • Shashi Sadasivan
      Recognized Expert Top Contributor
      • Aug 2007
      • 1435

      #3
      Originally posted by jayasabari
      hai,
      I am saving the images to the server by using response.saveas ("path name"). The images is saving the located path but the preview is not there. I am using in .net. please can you give any suggestion.

      With regards,
      k.Jayasabari.
      Open the file into a memory stream and use a bufferreader to convert it to byte[],
      and store the byte[] into the BLOB field of your DB.

      Code:
      BinaryFormatter bf = new BinaryFormatter();
                  MemoryStream ms = new MemoryStream();
                  bf.Serialize(ms, theImageFileObject);
                  byte[] byteArray = ms.ToArray();
      cheers
      Last edited by Shashi Sadasivan; Sep 13 '07, 06:32 AM. Reason: adding some code

      Comment

      • jayasabari
        New Member
        • Sep 2007
        • 25

        #4
        Originally posted by Shashi Sadasivan
        Open the file into a memory stream and use a bufferreader to convert it to byte[],
        and store the byte[] into the BLOB field of your DB.

        Code:
        BinaryFormatter bf = new BinaryFormatter();
                    MemoryStream ms = new MemoryStream();
                    bf.Serialize(ms, theImageFileObject);
                    byte[] byteArray = ms.ToArray();
        cheers

        Can you send ne the detail example codding please..

        Comment

        Working...