binary - Set FTP transfer type to binary

Syntax

binary(f)

Description

binary(f) sets the FTP download and upload mode to binary, which does not convert new lines, where f was created using ftp. Use this function when downloading or uploading any nontext file, such as an executable or ZIP archive.

Examples

Connect to the MathWorks FTP server, and display the FTP object.

tmw=ftp('ftp.mathworks.com');
disp(tmw)
FTP Object
  host: ftp.mathworks.com
  user: anonymous
   dir: /
  mode: binary

Note that the FTP object defaults to binary mode.

Use the ascii function to set the FTP mode to ASCII, and use the disp function to display the FTP object.

ascii(tmw)
disp(tmw)
FTP Object
  host: ftp.mathworks.com
  user: anonymous
   dir: /
  mode: ascii

Note that the FTP object is now set to ASCII mode.

Use the binary function to set the FTP mode to binary, and use the disp function to display the FTP object.

binary(tmw)
disp(tmw)
FTP Object
  host: ftp.mathworks.com
  user: anonymous
   dir: /
  mode: binary

Note that the FTP object's mode is again set to binary.

See Also

ftp, ascii

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS