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

Sidnei da Silva <sidnei-/awGbKECNgO/3pe1ocb+swC/[email protected]>
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Message-ID <20051205143219.GD4874@cotia>
On Mon, Dec 05, 2005 at 03:18:20PM +0100, Danny Bloemendaal wrote:
| 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.

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO! Please. With that
change your Zope will suffer quick death with large files. All the
file content will be loaded in memory.

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

No. That won't happen. You must be having a different issue. What that
is doing is to 'stream' the response. OFS.Image and OFS.File also do
it. And so does a lot of other places in Zope and nobody had problems
with it so far.

| 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 is indeed a bug.

-- 
Sidnei da Silva
Enfold Systems, LLC.
http://enfoldsystems.com


-------------------------------------------------------
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.