sourav
sourav

Reputation: 123

Segmented FTP upload

How can I upload a file in FTP in segmented way ? Is there any open source tool/library so that I can use it?. Is there any server side change needed to combine the uploads? Currently I am using vsftpd.

Upvotes: 1

Views: 973

Answers (2)

Martin Prikryl
Martin Prikryl

Reputation: 202534

In FTP protocol, you can implement a transfer by parts using REST command.

The REST command defines offset in a file, where transfer starts. You then transfer as many bytes as you want. And then you can restart the transfer again from a further offset.

vsftpd server supports REST command.

Upvotes: 1

James Gardiner
James Gardiner

Reputation: 402

The first thing to consider is that segmented transfers are not considered to be good net citizen behaviour. (i.e. you are gaming the system by setting up multi downloads on a shared link, gaining more than your fair share of bandwidth) As such, the protocol definitions do not support specifically segmented upload. (Or download for that matter) Resume yes.

Segmented DOWNLOAD is a hack by some tools that use the RESUME function of the protocol to transfer different parts of the same file at the same time.. this behaviour has a "NON-STANDARD" and not the intention of the protocol specifications.

Segmented UPLOAD is possible but the client AND ftpd server (or whatever protocol server your using) would need to support this NO-STANDARD and frowned upon implementation.

Again, this is not supported specifically in any standards as such poor behaviour is not encouraged by an open standard.

HOWEVER, you will find tools like lftp that support segmented ftp downloads. But currently, I have not seen any implementation of segmented upload that uses common open protocols like ftp.

I did find a java (Custom open source) based udp tool that did this, but udp needs tcp fallback if you want reliability in the internet. (udp is dropped by some internet gateways)

Upvotes: 1

Related Questions