Re: Problem Displaying Pics

2009-10-08 Thread Victor Subervi
I have come to the conclusion that this has absolutely nothing to do with the code. The problem is eNom. I have had so many problems with this provider specifically concerning their python interpreter that I actually filed a complaint against them with the BBB, which they still didn't resolve. Now

Re: Problem Displaying Pics

2009-10-08 Thread Gabriel Genellina
En Thu, 08 Oct 2009 12:30:16 -0300, Victor Subervi escribió: http://13gems.com/stxresort/cart/getpic1.py?id=1&x=1 On Wed, Oct 7, 2009 at 4:11 PM, Rami Chowdhury wrote: On Wed, 07 Oct 2009 14:05:25 -0700, Victor Subervi < victorsube...@gmail.com> wrote: print 'Content-Type: image/jpeg'

Re: Problem Displaying Pics

2009-10-08 Thread Victor Subervi
http://13gems.com/stxresort/cart/getpic1.py?id=1&x=1 TIA, V On Wed, Oct 7, 2009 at 4:11 PM, Rami Chowdhury wrote: > On Wed, 07 Oct 2009 14:05:25 -0700, Victor Subervi < > victorsube...@gmail.com> wrote: > > print 'Content-Type: image/jpeg' >> print 'Content-Encoding: base64' >> print >> print co

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
On Wed, 07 Oct 2009 14:05:25 -0700, Victor Subervi wrote: print 'Content-Type: image/jpeg' print 'Content-Encoding: base64' print print content.encode('base64') I did change it to text/plain, but I don't know how I'm supposed to manually decode it. Yes, it printed out a bunch of crap to t

Re: Problem Displaying Pics

2009-10-07 Thread Victor Subervi
print 'Content-Type: image/jpeg' print 'Content-Encoding: base64' print print content.encode('base64') I did change it to text/plain, but I don't know how I'm supposed to manually decode it. Yes, it printed out a bunch of crap to the screen. I've gotten that far before, and once I read "Adobe" som

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
On Wed, 07 Oct 2009 13:24:28 -0700, Victor Subervi wrote: I did that. In fact, just to make things easier, I wrote out exactly what is supposed to be rendered, as below: #!/usr/local/bin/python import cgitb; cgitb.enable() import MySQLdb import cgi import sys,os sys.path.append(os.getcwd()

Re: Problem Displaying Pics

2009-10-07 Thread Victor Subervi
I tried these combinations: print '''Content-Type: image/jpeg Content-Encoding: base64 ''' print print content.encode('base64') and print '''Content-Type: image/jpeg Content-Encoding: base64 ''' print content.encode('base64') Neither worked :( V On Wed, Oct 7, 2009 at 3:40 PM, Carsten Haese w

Re: Problem Displaying Pics

2009-10-07 Thread Carsten Haese
Victor Subervi wrote: > [...] > print '''Content-Type: image/jpeg > > Content-Encoding: base64 > ''' > [...] You have a spurious blank line between those header lines. HTH, -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem Displaying Pics

2009-10-07 Thread Victor Subervi
I did that. In fact, just to make things easier, I wrote out exactly what is supposed to be rendered, as below: #!/usr/local/bin/python import cgitb; cgitb.enable() import MySQLdb import cgi import sys,os sys.path.append(os.getcwd()) from login import login user, passwd, db, host = login() form =

Re: Problem Displaying Pics

2009-10-07 Thread Gabriel Genellina
En Wed, 07 Oct 2009 12:00:13 -0300, Victor Subervi escribió: > print '''Content-Type: image/jpeg > > ''' > print > print content On Wed, Oct 7, 2009 at 9:51 AM, Gabriel Genellina wrote: > That's still wrong. The output should be: > > - a line containing Content-Type: image/jpeg > - a blank line

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
On Wed, 07 Oct 2009 11:51:13 -0700, Victor Subervi wrote: My misunderstanding. Here's the new code: print '''Content-Type: image/jpeg Content-Encoding: base64 ''' Ah, sorry, I wasn't clear -- Content-Encoding is a header, and needs to go with Content-Type, before the newlines. So pri

Re: Problem Displaying Pics

2009-10-07 Thread Victor Subervi
My misunderstanding. Here's the new code: #!/usr/local/bin/python import cgitb; cgitb.enable() import MySQLdb import cgi import sys,os sys.path.append(os.getcwd()) from login import login user, passwd, db, host = login() form = cgi.FieldStorage() picid = int(form['id'].value) x = int(form['x'].val

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
On Wed, 07 Oct 2009 10:50:00 -0700, Victor Subervi wrote: Well, since the code is automatically generated, it printed this: #!/usr/local/bin/python import cgitb; cgitb.enable() import MySQLdb import cgi import sys,os sys.path.append(os.getcwd()) from login import login user, passwd, db, host

Re: Problem Displaying Pics

2009-10-07 Thread Victor Subervi
Well, since the code is automatically generated, it printed this: #!/usr/local/bin/python import cgitb; cgitb.enable() import MySQLdb import cgi import sys,os sys.path.append(os.getcwd()) from login import login user, passwd, db, host = login() form = cgi.FieldStorage() picid = int(form['id'].valu

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
On Wed, 07 Oct 2009 09:38:09 -0700, Victor Subervi wrote: Yes it is. I have had it print to screen already, and there is data in the database. V If you're confident that the data is correct and hasn't been corrupted, then I'm afraid I'm out of ideas. Perhaps you could try transmitting i

Re: Problem Displaying Pics

2009-10-07 Thread Victor Subervi
Yes it is. I have had it print to screen already, and there is data in the database. V On Wed, Oct 7, 2009 at 10:03 AM, Rami Chowdhury wrote: > On Wed, 07 Oct 2009 06:37:08 -0700, Victor Subervi < > victorsube...@gmail.com> wrote: > > I took out the line in question (with text/html). Now it prin

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
On Wed, 07 Oct 2009 06:37:08 -0700, Victor Subervi wrote: I took out the line in question (with text/html). Now it prints to screen the url. It did that before. Strange. Any other ideas? TIA, V Looking at the output, it seems the reason for this (for me) is that Firefox can't find the ima

Re: Problem Displaying Pics

2009-10-07 Thread Victor Subervi
Gabriel, don't you remember fighting this through with me a year or two ago? It worked just fine back then, but now the same code doesn't work! Go figure! We've tweaked it to this point: #!/usr/local/bin/python import cgitb; cgitb.enable() import MySQLdb import cgi import sys,os sys.path.append(os

Re: Problem Displaying Pics

2009-10-07 Thread Gabriel Genellina
En Tue, 06 Oct 2009 17:26:19 -0300, Victor Subervi escribió: The code in question is generated automatically from another script. I took your idea of the \r\n\r\n and added triple quoting and now it prints out this: That's still wrong. The output should be: - a line containing Content-Type

Re: Problem Displaying Pics

2009-10-07 Thread Victor Subervi
I took out the line in question (with text/html). Now it prints to screen the url. It did that before. Strange. Any other ideas? TIA, V On Tue, Oct 6, 2009 at 3:40 PM, Rami Chowdhury wrote: > On Tue, 06 Oct 2009 13:26:19 -0700, Victor Subervi < > victorsube...@gmail.com> wrote: > > The code in q

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
On Tue, 06 Oct 2009 13:26:19 -0700, Victor Subervi wrote: The code in question is generated automatically from another script. I took your idea of the \r\n\r\n and added triple quoting and now it prints out this: #!/usr/local/bin/python import cgitb; cgitb.enable() import MySQLdb import cg

Re: Problem Displaying Pics

2009-10-06 Thread Victor Subervi
The code in question is generated automatically from another script. I took your idea of the \r\n\r\n and added triple quoting and now it prints out this: #!/usr/local/bin/python import cgitb; cgitb.enable() import MySQLdb import cgi import sys,os sys.path.append(os.getcwd()) from login import log

Re: Problem Displaying Pics

2009-10-06 Thread Rami Chowdhury
On Tue, 06 Oct 2009 12:37:17 -0700, Victor Subervi wrote: I remember going round and round on this issue before until I finally got it right. I haven't changed the code. It worked before. I just tried your update and it gave me the same result :( Any other ideas? TIA, V I'm afraid changi

Re: Problem Displaying Pics

2009-10-06 Thread Victor Subervi
I remember going round and round on this issue before until I finally got it right. I haven't changed the code. It worked before. I just tried your update and it gave me the same result :( Any other ideas? TIA, V On Tue, Oct 6, 2009 at 2:24 PM, Rami Chowdhury wrote: > On Tue, 06 Oct 2009 12:19:56

Re: Problem Displaying Pics

2009-10-06 Thread Rami Chowdhury
On Tue, 06 Oct 2009 12:19:56 -0700, Victor Subervi wrote: Hi; I have the following archaic code that worked just fine for another site. It is called with the following url: http://13gems.com/stxresort/cart/getpic1.py?id=1&x=1 #!/usr/local/bin/python import cgitb; cgitb.enable() import My

Problem Displaying Pics

2009-10-06 Thread Victor Subervi
Hi; I have the following archaic code that worked just fine for another site. It is called with the following url: http://13gems.com/stxresort/cart/getpic1.py?id=1&x=1 #!/usr/local/bin/python import cgitb; cgitb.enable() import MySQLdb import cgi import sys,os sys.path.append(os.getcwd()) from lo