doom4ster
2017-11-30 1807a861b1b5f54ff5cbe249caf24f9b68ebd18e
CB_IMGPSScan.cab ver2.0.1.56  加上上傳大小限制   和  jpg 轉 tif 檔案大小縮減
修改3個檔案
47 ■■■■ 已變更過的檔案
CB_IMGPSScan.ocx 修補檔 | 檢視 | 原始 | 究查 | 歷程
CB_IMGPSScanImp.dcu 修補檔 | 檢視 | 原始 | 究查 | 歷程
CB_IMGPSScanImp.pas 47 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
CB_IMGPSScan.ocx
Binary files differ
CB_IMGPSScanImp.dcu
Binary files differ
CB_IMGPSScanImp.pas
@@ -564,6 +564,7 @@
    NowDivPageFormID:String;
    FirstDocDir : String;
    FMaxUploadSize:String;// 上傳zip大小限制
    Draging : Boolean;
@@ -2734,6 +2735,8 @@
      iGraphic_sec := TTiffGraphic.Create;
      iGraphic_First.Assign(ISB.Graphic);
      //ShowMessage(IntToStr(iGraphic_First.Palette.palNumEntries)); //彩色 會為0  黑白 為2
      MpsGetBarcode(ISB.Graphic, MpsBarcodeinf); //判斷A3 有用FormID 所以要先辨條碼
      //有必要的話先把影像轉正 再開始切圖
      If CheckNeedCrop(iGraphic_First) Then
@@ -2840,6 +2843,12 @@
              Break;
            End;
          End;
          if iGraphic.Palette.palNumEntries = 0 then  //20171130 彩色 會為0  黑白 為2
          begin
            iGraphic.Compression:=tcJPEG;
            iGraphic.JpegQuality:=70;
          end;
          If LowerCase(ExtractFileExt(SavePath + SaveFilename)) = '.tif' Then
          Begin
@@ -4039,10 +4048,10 @@
  //CreateFormID_FormName(DisplayPath);  //產生FormID_FormName.dat
  //CreateDocNo_DocName(DisplayPath); //產生DocNo_Name.dat
  //Showmessage(CreateDocNo_Info(DisplayPath));  //產生 Docno,份數,頁數;Docno,份數,頁數 的回傳字串
  lb1.Caption:='AAAAAAAAAAA';
  //lb1.Caption:='AAAAAAAAAAA';
  //Showmessage(CreateDocnoFrom_Info(NowCaseno));
  //Showmessage(self.CreateCustDocNoFrom_Info(NowCaseno));
  ShowMessage('FMaxUploadSize='+FMaxUploadSize);
        initkscan;
    showmessage('FUrl='+FUrl+#10#13+
    'FCaseID='+FCaseID+#10#13+
@@ -5142,6 +5151,11 @@
    begin
      PARA_CONTENT := GetSQLData(WORK_INF_List,'PARA_CONTENT',i);
      DivPageFormIDList.CommaText := PARA_CONTENT;
    end
    Else if UpperCase(GetSQLData(WORK_INF_List,'PARA_NO',i)) = 'MAX_UPLOAD_SIZE' Then     //取得 上傳大小的限制(MB)
    begin
      PARA_CONTENT := GetSQLData(WORK_INF_List,'PARA_CONTENT',i);
      FMaxUploadSize := PARA_CONTENT;
    end;
  end;
  ScanDuplex := Def_ScanDuplex;
@@ -6114,6 +6128,8 @@
  casepath:String;
  filesizeInt:integer;
  case_page:string;
  Fname:String;
  FileRec:TSearchrec;
begin
  Result := True;
  TransName := CaseID;
@@ -6177,7 +6193,7 @@
  for I := 0 to ST1.Count - 1 do
  begin
    if (Pos('_',St1.Strings[i])<>1) and (Pos('_',St1.Strings[i])<>-11) then
    if (Pos('_',St1.Strings[i])<>1) and (Pos('_',St1.Strings[i])<>-1) then
    begin
      str1:=Copy(ST1.Strings[i],1,Pos('_',St1.Strings[i])-1);
      ST2.Add(str1);
@@ -6231,6 +6247,27 @@
  if HaveMask then
    ZipMaskFile(Path,MaskPath,Path,'MaskImg.zip');  //有遮罩設定的才產生
  /////壓檔////
  ///檢查上傳的zip大小////
   FName :=Path+ 'Img.zip';
    FindFirst(FName, faAnyfile, FileRec);
    //FMaxUploadSize
//ShowMessage(IntToStr(FileRec.Size));
//Result:=False;
//exit;
    If FileRec.Size > StrtoInt(FMaxUploadSize) * 1048576 Then // 檢查檔案大小
    Begin
      ShowMessage(Format('%.3f', [FileRec.Size / 1048576]) +
        ' MB,超過上傳限制大小 '+FMaxUploadSize+' MB');
      FindClose(FileRec);
      Result := False;
      Exit;
    End;
    FindClose(FileRec);
  ///檢查上傳的zip大小////
//ShowMessage('last_add_formidstr='+last_add_formidstr);
  ////上傳/////
  SendData:='data='+HTTPEncode(UTF8Encode(FData))
  +'&verify='+FVerify
@@ -8941,7 +8978,7 @@
  ST1.LoadFromFile(path+'FormCode_Name.dat');
  for I := 0 to ST1.Count - 1 do
  begin
    if (Pos('_',St1.Strings[i])<>1) and (Pos('_',St1.Strings[i])<>-11) then
    if (Pos('_',St1.Strings[i])<>1) and (Pos('_',St1.Strings[i])<>-1) then
    begin
      str1:=Copy(ST1.Strings[i],1,Pos('_',St1.Strings[i])-1);
      LastInitFormidList.Add(str1);
@@ -14011,7 +14048,7 @@
  PageLVclear := True;
  InitialOk := False;
  FMaxUploadSize:='10';
  //FMode := 'DSCAN' ;
  //FIs_In_Wh := 'Y';
  if FIs_In_Wh = 'Y' then