[Zope] Re: Re: File uploads: filename with ';'
Tino Wildenhain
tino at wildenhain.de
Wed Oct 27 04:31:40 EDT 2004
hi,
On Wed, 2004-10-27 at 10:20, Vova wrote:
> Tino Wildenhain wrote:
>
> >> Simple script:
> >>
> >> return context.REQUEST.file.filename
> >>
> >> Now let's create the form for it and upload file "a;b".
> >> This script will return '"a' what is obviously not correct.
> >> Filename is used, for example, as ID for newly created File object.
> >> A lot of more realistic examples can be found in Plone.
> >
> > whatever Zope gives you as "filename" here comes from
> > the browser. So either the browser strips your filename
> > with ; in it (see with tcpflow or shanes tcpwatch)
> > or the browser doesnt do the quoting right.
> No, this is not browser mistake. This is part of output from netcat -l -p
> 8080:
> Content-Disposition: form-data; name="file"; filename="a;b"
> Content-Type: application/x-zerosize
>
> So filename is sent correctly as 'a;b'. But Zope says that filename is '"a'.
cool :-) We come close. Then you have to file a bug for the cgi.py
which does the hard work of reading and parsing. Looks like an
insufficience in handling of the " " quoting while parsing header
lines.
Regards
Tino
More information about the Zope
mailing list