Re: 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]>
Sidnei da Silva wrote:
> 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.
> 

Yeah, I thought so that's why I asked ;-)

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

Well, all I did was svn up the 2.1 bundle with Zope 2.8something. 
Instantiate a new Plone, add a File, add a Word document with an image. 
Try to edit it using FireFox 1.5 and ZopeExternalManager on OSx. Kaboom.
I debugged it using WinGDBG and as soon as that RESPONSE.write hit the 
fan, Firefox immediately tried to launche the file while WinGDBG was 
still debugging the code. Obviously the respons ended as far as the 
browser was concerned. So, I am really amazed that this is considered 
'working'.
Danny



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