Re: More & More Fun w/ Pics & MySQL

2009-10-18 Thread Gabriel Genellina
En Fri, 16 Oct 2009 16:23:31 -0300, Victor Subervi escribió: This will print all sorts of crap to the screen. I know it's an image, because for some reason "occasionally" it once upon a time today printed the actual image to the screen when I had these lines last:[...] Notice the commented

Re: More & More Fun w/ Pics & MySQL

2009-10-18 Thread Lie Ryan
Carsten Haese wrote: Victor Subervi wrote: Thank you all. I have __no__idea__ why the link I sent you, that you tested, __didn't__ work for me. Was it a problem with the browser? My Magic 8-Ball says "Unclear. Ask again later." Regarding Carsten's misunderstanding of my mentioning of comment

Re: More & More Fun w/ Pics & MySQL

2009-10-18 Thread Carsten Haese
Victor Subervi wrote: > Thank you all. I have __no__idea__ why the link I sent you, that you > tested, __didn't__ work for me. Was it a problem with the browser? My Magic 8-Ball says "Unclear. Ask again later." > Regarding Carsten's misunderstanding of my mentioning of commenting out > statements

Re: More & More Fun w/ Pics & MySQL

2009-10-18 Thread Victor Subervi
Thank you all. I have __no__idea__ why the link I sent you, that you tested, __didn't__ work for me. Was it a problem with the browser? Why did it render other images fine? Strange! Well, glad it works *today*. Hopefully it'll work tomorrow, when I try and pick up a check from my client! Regarding

Re: More & More Fun w/ Pics & MySQL

2009-10-17 Thread Neo
Hi, Victor Subervi schrieb: > Let me clarify. This prints out "all sorts of crap", which means an > image string, the image as a string, to the screen: > > print 'Content-type: image/jpeg' > print 'Content-Encoding: base64' > print > print pic().encode('base64') > print '' > > The following on

Re: More & More Fun w/ Pics & MySQL

2009-10-17 Thread Lie Ryan
Carsten Haese wrote: Victor Subervi wrote: [snip...] print 'Content-type: image/jpeg' print 'Content-Encoding: base64' print print pic().encode('base64') print '' [snip...] Why are you printing "" at the end of a page that is supposed to be a base64-encoded JPEG file? I'm testing my "psych

Re: More & More Fun w/ Pics & MySQL

2009-10-17 Thread Carsten Haese
Victor Subervi wrote: > in line... > > On Sat, Oct 17, 2009 at 11:33 AM, Carsten Haese > wrote: > Why would turning a comment into a statement NOT make a difference?!? > > > You misunderstood. Leaving in the __commented__ line __commented__ and > __not__unco

Re: More & More Fun w/ Pics & MySQL

2009-10-17 Thread Victor Subervi
in line... On Sat, Oct 17, 2009 at 11:33 AM, Carsten Haese wrote: > Victor Subervi wrote: > > Let me clarify. This prints out "all sorts of crap", which means an > > image string, the image as a string, to the screen: > > > > print 'Content-type: image/jpeg' > > print 'Content-Encoding: base64' >

Re: More & More Fun w/ Pics & MySQL

2009-10-17 Thread Carsten Haese
Victor Subervi wrote: > Let me clarify. This prints out "all sorts of crap", which means an > image string, the image as a string, to the screen: > > print 'Content-type: image/jpeg' > print 'Content-Encoding: base64' > print > print pic().encode('base64') > print '' This has no hope of working,

Re: More & More Fun w/ Pics & MySQL

2009-10-17 Thread Victor Subervi
Let me clarify. This prints out "all sorts of crap", which means an image string, the image as a string, to the screen: print 'Content-type: image/jpeg' print 'Content-Encoding: base64' print print pic().encode('base64') print '' The following once upon a time printed images, but now it doesn't.

Re: More & More Fun w/ Pics & MySQL

2009-10-16 Thread Carsten Haese
Victor Subervi wrote: > I'm sorry. These scripts worked fine before and should have been > plug-and-play. I have wasted 2 frustrating weeks trying to figure out > why they don't work only to discover things that make no sense at all > that do the trick. I thought programming was straight-forward an

Re: More & More Fun w/ Pics & MySQL

2009-10-16 Thread Victor Subervi
I'm sorry. These scripts worked fine before and should have been plug-and-play. I have wasted 2 frustrating weeks trying to figure out why they don't work only to discover things that make no sense at all that do the trick. I thought programming was straight-forward and "logical"...boy, am I disapp

Re: More & More Fun w/ Pics & MySQL

2009-10-16 Thread Carsten Haese
Victor Subervi wrote: > I was trying all sorts of crap. I tried it without, too. Still didn't > work :( Please help us help you. "Still didn't work" tells us nothing. See http://catb.org/~esr/faqs/smart-questions.html for hints on how you can ask a questions in a way that makes them more likely to

Re: More & More Fun w/ Pics & MySQL

2009-10-16 Thread Victor Subervi
I was trying all sorts of crap. I tried it without, too. Still didn't work :( V On Fri, Oct 16, 2009 at 4:42 PM, Carsten Haese wrote: > Victor Subervi wrote: > > [snip...] > > > > print 'Content-type: image/jpeg' > > print 'Content-Encoding: base64' > > print > > print pic().encode('base64') > >

Re: More & More Fun w/ Pics & MySQL

2009-10-16 Thread Carsten Haese
Victor Subervi wrote: > [snip...] > > print 'Content-type: image/jpeg' > print 'Content-Encoding: base64' > print > print pic().encode('base64') > print '' > > [snip...] Why are you printing "" at the end of a page that is supposed to be a base64-encoded JPEG file? -- Carsten Haese http://informi

More & More Fun w/ Pics & MySQL

2009-10-16 Thread Victor Subervi
Hi; Okay, here's the code: #! /usr/bin/python import cgitb; cgitb.enable() import MySQLdb import cgi import sys,os sys.path.append(os.getcwd()) from login import login def pic(): user, passwd, db, host = login() form = cgi.FieldStorage() db = MySQLdb.connect(host, user, passwd, db) cursor=