发明名称 Automatic determining of file transfer mode
摘要 A mechanism is provided for automatic determining of file transfer mode. A locale or an operating system of a client in a file transfer is determined. At least part of a transfer file is downloaded in a first text format to obtain first resulting bytes. The first resulting bytes are analyzed to determine whether the first resulting bytes match a character set of the locale or the operating system of the client above a first predetermined threshold. A determination is made as to whether the first text format should be used for downloading the transfer file based on whether the first resulting bytes match the character set of the locale or the operating system of the client above the first predetermined threshold. Responsive to the first resulting bytes matching above the first predetermined threshold, the transfer file is downloaded in the identified first text format.
申请公布号 US9130913(B2) 申请公布日期 2015.09.08
申请号 US201313742957 申请日期 2013.01.16
申请人 International Business Machines Corporation 发明人 Horsman Steven J.;Stone Colin C.;Winchester Joseph R.
分类号 G06F15/16;H04L29/08 主分类号 G06F15/16
代理机构 代理人 Lammes Francis;Walder, Jr. Stephen J.;Stock William J.
主权项 1. A method for automatic determining of file transfer mode, comprising: determining a locale or an operating system of a client in a file transfer; downloading at least part of a transfer file in a first text format to obtain first resulting bytes; analyzing the first resulting bytes to determine whether the first resulting bytes match a character set of the locale or the operating system of the client above a first predetermined threshold; determining whether the first text format should be used for downloading the transfer file based on whether the first resulting bytes match the character set of the locale or the operating system of the client above the first predetermined threshold; responsive to the first resulting bytes matching the character set of the locale or the operating system of the client above the first predetermined threshold and determining that there are no characters of the at least part of the transfer file that do not fall within the character set of the first text format, downloading the transfer file in the first text format and saving the transfer file in the first text format; responsive to the first resulting bytes matching the character set of the locale or the operating system of the client above the first predetermined threshold but determining that there are characters of the at least part of the transfer file not falling within the character set of the first text format, downloading the transfer file in a second text format with a text character set in a form of a code page for a second text language and saving the transfer file in the second text format; responsive to the first resulting bytes failing to match the character set of the locale or the operating system of the client above the first predetermined threshold, downloading the at least part of the transfer file in a binary format to obtain second resulting bytes; analyzing the second resulting bytes to determine whether the second resulting bytes match the character set of the locale or the operating system of the client above a second predetermined threshold; determining whether the binary format should be used for downloading the transfer file based on whether the second resulting bytes match the character set of the locale or the operating system of the client above the second predetermined threshold; responsive to the second resulting bytes matching the character set of the locale or the operating system of the client above the second predetermined threshold, downloading the transfer file in its entirety in the binary format; and saving the transfer file in the binary format.
地址 Armonk NY US