-
Notifications
You must be signed in to change notification settings - Fork 75
Description
Description
This issue requests the implementation of the STOU (Store Unique) command, an optional feature in the FTP protocol, to enhance server functionality and robustness against file name collisions during uploads.
The STOU command allows a client to upload a file and instruct the server to automatically generate a unique file name for the stored data, ensuring that no existing file is accidentally overwritten.
Reference and Behavior (Based on RFC 959 and Common Practice)
The implementation should adhere to the following key behavioral rules:
- Argument Handling: The file name/path argument for the STOU command is optional as per the standard.
- Unique Naming Principle: The server is responsible for generating and assigning a unique name to the file being uploaded.
- Success Response: Upon successful completion, the final server response code 226 must explicitly include the unique file name the server used to save the file.
Proposed Naming Logic
The server should apply the following logic to generate the unique file name:
If a file name is provided (Optional Path):
- The server should check if the provided file name already exists.
- If it exists, the server must append the current timestamp (or a sequence number) to the provided name to make it unique.
If no file name is provided:
- The server should construct a unique file name using the format: YYYYMMDDHHMMSS_FILE. This format uses the current date and time down to the second, which inherently creates a highly unique string.
I am interested in implementing this feature if this proposal is approved and assigned. Please let me know if there are any specific guidelines or architectural points I should be aware of before starting development.