f1= open("file1.pdf", "rb") x = f1.read() open("file2.pdf", "wb").write(x)
works... thanks sandip On Nov 27, 5:43 pm, sandipm <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to read a file and write into other file. if I do it for > simple text file, it works well. > but for pdfs or some other mime types, its failing. > > actually main problem is i am uploading file using cgi, in this > process I am getting content of file, and I am > trying to save the file. I think I need to specify mimetype of file > somehow..? > any quick solutions? or need to google. > > sandip -- http://mail.python.org/mailman/listinfo/python-list