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?<br>TIA,<br>V<br>
<br><div class="gmail_quote">On Tue, Oct 6, 2009 at 2:24 PM, Rami Chowdhury <span dir="ltr"><<a href="mailto:rami.chowdhury@gmail.com">rami.chowdhury@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Tue, 06 Oct 2009 12:19:56 -0700, Victor Subervi <<a href="mailto:victorsubervi@gmail.com" target="_blank">victorsubervi@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi;<br>
I have the following archaic code that worked just fine for another site. It<br>
is called with the following url:<br>
<br>
<a href="http://13gems.com/stxresort/cart/getpic1.py?id=1&x=1" target="_blank">http://13gems.com/stxresort/cart/getpic1.py?id=1&x=1</a><br>
<br>
#!/usr/local/bin/python<br>
import cgitb; cgitb.enable()<br>
import MySQLdb<br>
import cgi<br>
import sys,os<br>
sys.path.append(os.getcwd())<br>
from login import login<br>
user, passwd, db, host = login()<br>
form = cgi.FieldStorage()<br>
picid = int(form['id'].value)<br>
x = int(form['x'].value)<br>
pics = {1:'pic1',2:'pic2',3:'pic3',4:'pic4',5:'pic5',6:'pic6'}<br>
pic = pics[x]<br>
print 'Content-Type: text/html'<br>
</blockquote>
<br></div>
^^^ I believe this is the problem line. It's telling the browser to expect HTML, not an image. Remove this, and the later Content-Type header that's being printed ("Content-Type: image/jpeg") should take effect.<br>
<font color="#888888">
<br>
<br>
-- <br>
Rami Chowdhury<br>
"Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Razor<br>
408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD)<br>
</font></blockquote></div><br>