cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [patch] use only basename in "filename" attribute in -F post

From: Jamie Lokier <jamie_at_shareable.org>
Date: Tue, 28 Sep 2004 16:12:36 +0100

Daniel Stenberg wrote:
> >browsers I checked (IE, mozilla, konqueror) seem to agree in putting just
> >the basename of the file there.
>
> Are you _sure_ that all browsers do this on all operating systems no matter
> what path you use? I am very sure at least some browsers on some operating
> systems have passed along the full path at some point. (Since I spent a few
> days debugging exaclty such a case a few years back when I introduced the
> way to set only the file name.)

I believe you (Daniel) are correct.

The server-side Perl module CGI::Upload goes to great effort to deduce
an uploaded file's basename from the name supplied by the client. It
is complicated because "/" is not always the path separator used by
clients -- it can depend on the client's operating system.
CGI::Upload would only do this if it were the behaviour of some clients.

I would imagine that all _modern_ versions of popular browsers only
send the filename, not the full path, although I haven't checked.

That is the behaviour that seems most useful to me, precisely because
the server has no way to determine the file name unambiguously from
the OS-dependent path syntax.

-- Jamie
Received on 2004-09-28