I have a small python cgi script that accepts an image upload from the user, converts in into a different format, and saves the new file in a temp location. I would like it to then automatically prompt the user to download the converted file. I have tried:
# image conversion stuff....
print "Content-Type: image/eps\n" #have also tried application/postscript, and application/eps
print "Content-Disposition: attachment; filename=%s\n" % new_filename #have tried with and without this...
print open(converted_file_fullpath).read()
print
I have also tried:
print "Location: /path/to/tmp/location/%s" % new_filename
print
My browser either downloads script.cgi
or script.cgi.ps
. Any help is appreciated.