Пример #1
0
 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);
     }
 }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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);
            }
        }