Openssh sftp-server: .filepart support?

Posted by Guillaume Bodi on Server Fault See other posts from Server Fault or by Guillaume Bodi
Published on 2011-06-22T07:29:45Z Indexed on 2011/06/22 8:24 UTC
Read the original article Hit count: 432

Filed under:
|
|

I am trying to setup a SFTP server, running off Ubuntu Server 11.04. I installed openssh-server to provide SSH access. What I am trying to do is make file uploads run with a suffix (.filepart or whatever), which would be removed upon transfer completion.

The flow idea is:

  1. User uploads cat.jpg
  2. The server starts writing cat.jpg.filepart in the destination directory
  3. Once the upload completes, the server trashes the previous cat.jpg (if any) and renames cat.jpg.filepart to cat.jpg

This is to make sure that incomplete file uploads do not overwrite the existing files. Any idea on how I can do this?

Thanks

© Server Fault or respective owner

Related posts about ssh

Related posts about sftp