Hi, tom schrieb: > I think I tried everything but it still doesn't work. Sometimes > file.tell() gives me the file size after using it with PIL, but not > reliably. I had the same problem with uploaded audio files but there I > could work around it by using a metatag reader. Can anybody spot my > mistake? I'd be glad to add more info if needed. Browsers usually do not transmit the size for individual files. The best solution is to move the file pointer to the last position and then use tell on it. Don't forget to revert it to the beginning:
f.seek(0, 2) length = f.tell() f.seek(0) do_something_with_the_file(f) Regards, Armin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pocoo-libs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pocoo-libs?hl=en -~----------~----~----~----~------~----~------~--~---
