By default, FTP automatically disconnects after five minutes of inactivity. The following command increases the time. Once you made a FTP connection type the following command.
Quote time 1000 (This increases idle time to 1000 seconds)
Likewise specify required time.