Assuming your upload_file.file.read() function works, the overwriting should be the only issue. Just want to point out that total_data += data is not advisable for this example (speed/efficiency issue, although i'm sure it could probably be even faster than what I replace it with if u decided to use arrays, but it's probably not worth it XD), and I think open() was replaced by file(), although they're probably interchangable.
new code ----------------- total_data = ' ' temp_data = [] while True: data = upload_file.file.read(8192) if not data: break temp_data.append(data) total_data = ' '.join(temp_data) somefile = file(target_file_name, 'wb') somefile.write(total_data) f.close() ------------------- OriginalBrownster wrote: > I am currently uploading a file from a users computer to the file > system on my server using python, just reading the file and writing the > binaries. > > total_data=' ' > while True: > data = upload_file.file.read(8192) > if not data: > break > total_data += data > f = open(target_file_name, 'wb') > f.write(total_data) > f.close > > However when i download the file from the server it is not intact and > it cannot be opened. It is happening with every type of file. > > It seemed to be working before and now it is..maybe I goofed up and > deleted something. > However I can't seem to find it. > > any ideas?? -- http://mail.python.org/mailman/listinfo/python-list