[Zope] uploading text file by FTP: encoding problem?

Dieter Maurer dieter at handshake.de
Wed Aug 9 13:32:44 EDT 2006


Eric Fernandez wrote at 2006-8-9 11:20 +0100:
>I have a problem when I upload an ASCII text file into a zope2 folder. I 
>have a plain-text file with double quotes and line breaks. However, once 
>uploaded, double quotes become &quot and line breaks become \n. Even if 
>I change the property into text/plain or text/xml, I get the same problem.

The default object type generated for "text/html", "text/xml" or
"text/plain" is a "DTMLDocument" (and not a "File" object as you might
except).

The "__str__" method of "DTMLDocument" performs HTML escaping.
That's why '"' may appear as """.


You can install your own "PUT_factory" (search the mailing list archives
for details) to control the type of object created during various
types of uploads.



-- 
Dieter


More information about the Zope mailing list