Code:Get_Attribute DF_FIELD_LENGTH of R1BIN.FILE_NUMBER 3 to iMaxChunkSize // this is 16336 Move (iMaxChunkSize-2) to iMaxChunkSize Repeat Set_Channel_Position iChIn to (iPos) If ((iLength-iPos)<iMaxChunkSize) Move (iLength-iPos) to iReadLength Else Move iMaxChunkSize to iReadLength Read_Block channel iChIn MyDoc iReadLength Clear R1BIN Reread Move iNumber to R1BIN.FILEREP Move (SYSTEM.LAST_FBINARY+1) to R1BIN.Number Move (SYSTEM.LAST_FBINARY+1) to SYSTEM.LAST_FBINARY //Move MyDoc to FBINARY.CONTENT Set_Field_Value R1BIN.File_Number (RefTable(R1BIN.Content)) to MyDoc Move iReadLength to R1BIN.LEngth SaveRecord SYSTEM R1BIN Unlock Move (iPos+iReadLength) to iPos Until (iPos>=iLength)