Helpppp - Problems with big files
Hi again: In a request I need to response a big file in the body of the response (around 1Gb or 1,5Gb). All I do is: response.setHeader('content-lenght',size) response.setHeader('content-Disposition',loc) f.open('file') data = f.read() response.write(data) sometime later Zope writes a "memory error". I have divided the data in little chunks too and make a lot of response.write calls, but the problem persist... How I can resolve this problem?... is very important... Thanks... -- Microsoft merges technologoies: Windows CE + Windows ME + Windows NT = Windows CEMENT ---- Antonio Beamud Montero Agora Systems S.A. http://www.agoratechnologies.com
Try again with the chunks, this is the way to go. See OFS/Image.py for how this is done by Zope's File and Image objects. There are some Products that may help you with serving local files. LocalFS and ExternalFile come to my mind. Stefan --On Mittwoch, 30. Oktober 2002 18:49 +0100 Antonio Beamud Montero <antonio.beamud@agora-2000.com> wrote:
Hi again: In a request I need to response a big file in the body of the response (around 1Gb or 1,5Gb). All I do is: response.setHeader('content-lenght',size) response.setHeader('content-Disposition',loc) f.open('file') data = f.read() response.write(data)
sometime later Zope writes a "memory error". I have divided the data in little chunks too and make a lot of response.write calls, but the problem persist...
How I can resolve this problem?... is very important...
Thanks... -- Microsoft merges technologoies: Windows CE + Windows ME + Windows NT = Windows CEMENT
---- Antonio Beamud Montero Agora Systems S.A.
http://www.agoratechnologies.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Those who write software only for pay should go hurt some other field. /Erik Naggum/
On Wednesday 30 October 2002 19:49, Antonio Beamud Montero wrote:
response.setHeader('content-lenght',size) response.setHeader('content-Disposition',loc) Where is the Content-Type?
How I can resolve this problem?... is very important... Well... Did you mean *body* (HTML? Plain-Text?) or exactly file to download? HTTP is not designed to big files transfer. It is designed to transfer a text. You can split whole file into the smaller pieces then send or do this via File Transfer Protocol (FTP), which IS designed to transfer files even that big files.
-- Regards, Bogdan "Wipe Info uses hexadecimal values to wipe files. This provides more security than wiping with decimal values." -- Norton SystemWorks 2002 Manual
participants (3)
-
Antonio Beamud Montero -
Bo M. Maryniuck -
Stefan H. Holek