Hi Jonothan!
I've got a patch for LocalFS you may want to consider.
If a file is very big, its ob.data is not a string, but
a <pdata instance>, which guess_content_type doesn't
grok. Here, I just grab the first chunk and pass it to
guess_content_type instead.
If you would prefer, just add me as a developer, and
I'll check it in myself!
thanks,
-steve
[vh10-33:~/Development/LocalFS] steve% cvs diff -c
FSObject.py
Index: FSObject.py
===================================================================
RCS file:
/cvsroot/localfs/src/lib/python/Products/LocalFS/FSObject.py,v
retrieving revision 1.16
diff -c -r1.16 FSObject.py
*** FSObject.py 7 Feb 2003 07:34:36 -0000 1.16
--- FSObject.py 30 Mar 2003 12:43:53 -0000
***************
*** 1525,1532 ****
ob._fs_load()
if ob.meta_type in ('File','Image'):
# Try to guess the content type.
!
content_type,encoding=guess_content_type(path,ob.data,
! container._fs_root.default_type)
ob.content_type=content_type
# Store the properties.
ob._fs_store_props()
--- 1525,1537 ----
ob._fs_load()
if ob.meta_type in ('File','Image'):
# Try to guess the content type.
! content_type =
container._fs_root.default_type
! data = ob.data
! if type(data) != type(''):
! data = data.data
!
!
content_type,encoding=guess_content_type(path, data,
content_type)
!
ob.content_type=content_type
# Store the properties.
ob._fs_store_props()
patch as a file..