External editing with 'large' Files doesn't work (manage_FTPget borked?)

Danny Bloemendaal <danny.bloemendaal-YihP0OB+nP1UH/[email protected]>
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Message-ID <[email protected]>
Today I stumbled upon a problem while trying to edit Word documents 
using the External Editor. It turned out that it fails if the file is 
too large. I couldn't find if this was fixed or not but in my svn bundle 
checkout for Plone I didn't see it.

I tracked it down to WebDAVSupport.py, line 118:

     while data is not None:
         RESPONSE.write(data.data)
         data=data.next


As soon as this line is executed, the browser gets the incomplete 
response and doesn't know what to do with the file. I changed this code to:

     sdata=''
     while data is not None:
         sdata=sdata+data.data
         data=data.next

     return sdata

And at least af this I was able to edit the document again. However, I 
have absolutely no idea if this is the proper way to do it.

Can someone (Sidnei?) confirm this and check this into Archetypes (if 
it's not already there somewhere)?

Related to this, I also noticed a likely bug in Marshall.py line 174. 
If line 169 get's executed, line 174 undoes this:


             if hasattr(p, 'get_size'):
169:            length = p.get_size(instance)
             else:
                 # DM: this almost surely is stupid!
                 length = len(data)

174:        length = len(data)


That doesn't seem right at all!

Danny Bloemendaal



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.