Re-post: Issue when uploading a txt file to create a Page content type in Plone
[I am reposting because my poist did not show in the whole day]
I am running Plone 3.3.4 on windows platform, and need to upload a text file
generated by an external program to a specific folder in a Plone site.
I have used this approach for other websites and text files generated by
other programs without hitting any issue, but this time the Page that I get
into the website is missing the first line of text. This happens for any
text file generated by such external program, but I have looked at this file
without seeing anything special about it. Is a Unix file, and it contains
only ascii chars.
I did try to read the file with python and I do read all of the content.
I tried to find out what was going on and traced the manage_afterPUT in the
I found out that, whilst the variable "content" is getting all of the text
from file.read(), at that point self.getRawText() returns the text without
the first line. And, as the txt file content is not html, is not manipulated
I was not able to find where the text field value was set. The only
workaround I found was to create a custom type based on ATDocument and
override manage_afterPUT to set the text field with "content" as following: