RFC 949 UNKNOWN APPLICATIONS · FILE TRANSFER

FTP STOU: FTP unique-named store command

Upload files with server-generated unique names in FTP.

On rfc-editor.org ↗
PUBLISHED
July 1985
AUTHORS
M.A. Padlipsky
STREAM
Legacy
NEW COMMAND
STOU
RESPONSE CODE
250 (Transfer Started)
FILENAME RETURNED IN
Response message free text
DOI
10.17487/RFC0949

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
Network Working Group                                     Mike Padlipsky
Request for Comments: 949                                          Mitre
Semisupersedes RFC 505                                         July 1985

                     FTP UNIQUE-NAMED STORE COMMAND


STATUS OF THIS MEMO

   This RFC proposes an extension to the File Transfer Protocol for the
   ARPA-Internet community, and requests discussion and suggestions for
   improvements.  Distribution of this memo is unlimited.

DISCUSSION

   There are various contexts in which it would be desirable to have an
   FTP command that had the effect of the present STOR but rather than
   requiring the sender to specify a file name instead caused the
   resultant file to have a unique name relative to the current
   directory.  This would be useful for all sorts of "pool" directories;
   the directories that serve as queues for printer daemons come
   immediately to mind (so do fax and even cardpunch daemons' queues),
   although naturally the sort of printer queue that a local command has
   to manage the interface to isn't what's meant by "pool" in this
   context.

   If we accept the need for such an FTP extension, and that it should
   not be done with an "X" command because it needs to be relied on
   "everywhere," the interesting question then becomes how to mechanize
   it.  Probably the most natural way to do it would be either to add a
   "control argument" of -UNM to the syntax of STOR, now that there are
   enough UNIXtm's around so that this good old Multics trick isn't
   alien any more, or even to declare that STOR with no argument should
   cause a directory-unique name to be generated.  However, either of
   these would necessitate "reopening" the STOR command code, which is a
   distasteful sort of exercise.  Since most FTP's presumably do a
   dispatch sort of thing off a list of command names to begin with,
   then, an additional command would seem to be the way to go.

   Naming the command calls for a bit of thought.  STore Uniquely Named
   (-> STUN) is silly; UNIQue comes to close to free advertising or even
   trademark infringement (and confuses fingers if you're typing); Store
   Uniquely NaMed (-> SUNM) doesn't avoid free advertising either;
   Uniquely Named STore (-> UNST) might look like a synonym for DELEte,
   though it's not all that bad; SToRe Uniquely named (-> STRU) is
   taken; and so it goes.  The best bet seems to be STOU.

   Of somewhat more practical import, there's also the question of
   whether the sender needs to be apprised of what the unique name
   turned out to be.  Intuitively, sometimes this would be the case and
   sometimes it wouldn't.  Making it optional is almost certainly too

FTP Unique-Named Store Command


   much like work, though--even if it does have the subtle virtue of
   finally getting control arguments into FTP.  Therefore, why not just
   include it in a suitable response-code's free text field (unless, of
   course, an avalanche of comments comes in urging it not be done at
   all)?

   Note, by the way, that the intent here is emphatically not to
   sidestep whatever access control, authentication, and accounting
   mechanisms Hosts might have in play before the user can do an old
   STOR or a new STOU, but with suitable publicized ID's and passwords
   it could be almost as good as the proposal made in RFC 505.

RECOMMENDATION

   Add a new command, STOU, to FTP, which behaves like STOR except that
   the resultant file is to be created in the current directory under a
   name unique to that directory.   The 250 Transfer Started response
   should include the name generated (unless the copy of FTP I have is
   so old that 250 isn't the right number any more).

AI ELI5

On this page
PROBLEMFTP applications need to upload files to queue directories where the server must pick unique names to avoid collisions, rather than the client specifying names.
MECHANISMRFC 949 adds a new STOU command to FTP that behaves like STOR except the server chooses a unique filename in the current directory and returns it to the client.
WHY IT MATTERSThis solves the problem of applications that manage shared resource pools such as printer daemon queues, fax queues, or job submission directories.

§1The STOU Command

RFC 949 proposes a new FTP command called STOU (Store Uniquely Named) that extends the File Transfer Protocol. The command works like the existing STOR command, which uploads a file, but instead of the client specifying a filename, the server generates a unique name for the file in the current directory.

This is useful for pool directories such as printer daemon queues, fax queues, and other systems where multiple programs or users need to submit jobs without coordinating on filenames.

FTP is a way to copy files over the Internet. STOU is like STOR, but instead of you picking the file's name, the server picks a name that is different from all other files there.

§2How STOU Works

When a client sends the STOU command, it opens a data connection and sends file content, just like STOR. The server creates the file with a unique name in the current directory. Unlike other FTP responses, the server must include the actual filename it chose in its response message. The response code is 250 (Transfer Started), and the filename appears in the free-text portion of the response.

The design avoids reopening the existing STOR command, which would break backward compatibility, and instead adds a new command that is easy for FTP implementations to dispatch.

The server listens to your file data, picks a name that nobody else is using, and tells you what name it picked so you know where to find it.

§3Why This Matters

Many network systems use shared queues where programs or users deposit work: printers, fax systems, job schedulers, and other daemons. Without STOU, each client must either coordinate with others to avoid filename conflicts or risk losing data if two submissions arrive with the same name. The RFC notes that STOU would be as reliable as the FTP server's own internal access controls and could be useful wherever the RFC 505 proposal (which suggested a dedicated unique-name directory) was considered.

When many people want to send in their homework at the same time, they need to make sure nobody sends it under the same name. STOU lets the teacher's mailbox pick a name for each student automatically.

§4References