private bool saveImg(productImage pic) //사진 업로드 (ftp) { try { if (!((pic.parameter == "no image") || (pic.registeredImgName == ""))) { imgUploadHelper ftpClient = new imgUploadHelper(commonVar.userFTPServerIP, commonVar.userFTPID, commonVar.userFTPPassword); string ftpFilePath = "JEPUM/" + txt_id.Text + "/" + pic.registeredImgName; if (ftpClient.Upload(pic.imgLocalPath, ftpFilePath)) { pic.parameter = imgDBpath + ftpFilePath; return(true); } else { return(false); } } else { return(true); } } catch (Exception ex) { MessageBox.Show(ex.Message + "\n\r 이미지 업로드에 실패했습니다.", "이미지 업로드 에러"); return(false); } }
private bool deleteImage(string imgName) { imgUploadHelper ftpClient = new imgUploadHelper(commonVar.userFTPServerIP, commonVar.userFTPID, commonVar.userFTPPassword); string ftpFilePath = "JEPUM/" + txt_id.Text + "/" + imgName; if (ftpClient.DeleteFile(ftpFilePath)) { return(true); } else { return(false); } }
private bool deleteDirectory(string productID) { imgUploadHelper ftpClient = new imgUploadHelper(commonVar.userFTPServerIP, commonVar.userFTPID, commonVar.userFTPPassword); string ftpDirPath = "JEPUM/" + productID; if (ftpClient.DeleteDirectory(ftpDirPath)) { return(true); } else { return(false); } }