You must Sign In to post a response.
  • Category: .NET

    "please help me", "I have a problem"

    The forum thread has not been reviewed by Editors yet. Readers are advised to use their best judgement before accessing this thread.
    This thread will be reviewed shortly.
    If you think this thread contain inappropriate content, please report to webmaster.
    My program is : Register for study so I want the student register for study with their information like : name ,last name ,sex ,date of birth, age ,........., and photo so the code for the student can attach a photo to show ,,that i would like to know the code for the photo could you help me
  • #764707
    Make on temp folder in that, save the photo and show the photo from that folder with uploaded name then you delete


    string fn = System.IO.Path.GetFileName(File1.PostedFile.FileName);
    string SaveLocation = Server.MapPath("Data") + "\\" + fn;
    File1.PostedFile.SaveAs(SaveLocation);

    Image.Url=SaveLocation.Tostring();

    If you want to delete
    delete the file

  • #766535
    Hi,

    Kindly go through the following Links. It May helps you lot to do your Requirement.
    1.http://www.c-sharpcorner.com/UploadFile/ed8f22/save-and-retrieve-image-from-sql-in-VB-Net/

    2.http://www.c-sharpcorner.com/UploadFile/0c1bb2/uploading-images-to-database-using-Asp-Net-C-Sharp/

    3.http://www.c-sharpcorner.com/UploadFile/b926a6/employee-registration-from-with-employee-images-save-in-data/

    In that Links they have explained Lot.

    Regards,
    Karunanidhi.K

  • #770079
    You can use photoupload or file upload control from .net framework that should solve your problem.

    or you can use the following code

    On button click event you can load an image by creating an object of Image class like

    Image img=Image.FromFile("path of file"); or you can take the path of file from the file upload control.


    And then load it by using image property of PictureBox like

    PictureBox.Image =img;


    After that, I guess you want to save that image to another location for that you can use Copy method of File class like

    File.Copy(sourceaddress,destinationadress);

    Thanks and Regards
    Miss Meetu Choudhary (Site Coordinator)
    Go Green Save Green


  • Sign In to post your comments