COPY FILE (ThisForm._Image1.Picture) TO (CCFront+ImageFN)instead of the lines dealing with Gdiplus
oImage=NEWOBJECT("Gpimage","Gdiplus.prg") oImage.CreateFromFile((ThisForm.imgphoto.Picture)) oImage.SaveToFile((CCFront+ImageFN),"image/jpeg") oImage=""If you can't be sure that the photos will be JPG's then you will have to save the file extension when the photo is selected and store it in the student record so that it can be used to save and retrieve the photo.
ImageFN=RTRIM(docstring)+".jpg"to
ImageFN=RTRIM(docstring)+stored_file_extension