Patent ID: 9130913
Filing Date: 2015-09-08
Classification: H04L

Abstract:
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.