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:
- User uploads
cat.jpg
- The server starts writing
cat.jpg.filepart
in the destination directory - Once the upload completes, the server trashes the previous
cat.jpg
(if any) and renamescat.jpg.filepart
tocat.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
Best Answer
ProFTPD can support SFTP via the mod_sftp module, and can do just what you describe with its
HiddenStores
directive; this functionality is supported for both FTP and SFTP uploads.Full disclosure: I'm the author of ProFTPD and mod_sftp.