Re: Get the entire file in a variable - error

2005-04-14 Thread John Machin
On 14 Apr 2005 07:37:11 -0700, [EMAIL PROTECTED] wrote: >H! > >I'm using a database and now I want to compress a file and put it into >the database. > >So I'm using gzip because php can open the gzip file's. >The only problem is saving the file into the database. > >The function below does this: >

Re: Get the entire file in a variable - error

2005-04-14 Thread Larry Bates
In the future it REALLY helps if you post the code that you used to open and read the file. Otherwise we have to "guess" what you may of done. That said, I'll try to guess: 1) Your code shows that you instantiate GzipFile class with mode "w". I don't know what your data looks like but normally

Re: Get the entire file in a variable - error

2005-04-14 Thread Pokerface
What kind of DB? Maybe the field type you're hunting for is a BLOB? Or perhaps you need to be formatting the string differently than it's entered (like php's addslashes() or something)? -- Pokerface:: Posted from Tactical Gamer - http://www.TacticalGamer.com :: -- http://mail.python.org/mai

Re: Get the entire file in a variable - error

2005-04-14 Thread martijn
I mean it like this. I must have a variable that includes a file (in this case a .gz file) for putting that in a database. (never null) Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: Get the entire file in a variable - error

2005-04-14 Thread Jeff Epler
It's not clear to me what you mean by "the first line" (gzip does not output a file composed of lines, its output is byte-oriented). Printing tst.getvalue() is probably not a very useful thing to do, since it won't do anything useful when the output is a terminal, and it will add an extra newline

Get the entire file in a variable - error

2005-04-14 Thread martijn
H! I'm using a database and now I want to compress a file and put it into the database. So I'm using gzip because php can open the gzip file's. The only problem is saving the file into the database. The function below does this: - gzip the file [oke] - get all the bytes with tst.getvalue() [erro