Import/Upload ZEXP files PROBLEMS !
Hi I have a folder in Zope's ROOT called TEST. In this folder I create 2 DTML Methods: 'start_html' with the following content: '<table><tr><td>' ------------ ----------------- and 'stop_html' with the following content: '</td></tr></table>' ----------- -------------------- Now, I export the 2 DTML Methods in 2 zexp files: start_html.zexp and stop_html.zexp Now, I upload the 2 zexp files in Zope as File objects (in the TEST folder for example). So, in the TEST folder I have 2 files called start_html.zexp and stop_html.zexp. (Why do I do this? Because I want to have a folder with zexp files for download...) And now comes THE PROBLEM. The start_html.zexp has 'text/html' content type and stop_html.zexp has 'application/octet-stream' content type !!?? Why is that????? I need some help with this one 'cause I can't understand it ... Even if I set the 'application/octet-stream' content type in start_html.zexp it doesn't work!!?? I tried this on Zope 2.5.1 and 2.6.1, both Windows and Linux operating systems using the following browsers: IE, Mozzila and Netscape. If I change the content type to 'application/octet-stream', then Netscape "knows" to download the file but when I try to import it I get an error: Error Type: OverflowError Error Value: long int too large to convert so I think the file is corupt or something ... Thanks a lot Dragos
Dragos Chirila wrote at 2004-1-20 15:45 +0200:
... I have a folder in Zope's ROOT called TEST. In this folder I create 2 DTML Methods:
'start_html' with the following content: '<table><tr><td>' ------------ -----------------
and
'stop_html' with the following content: '</td></tr></table>' ----------- --------------------
Now, I export the 2 DTML Methods in 2 zexp files: start_html.zexp and stop_html.zexp ... And now comes THE PROBLEM. The start_html.zexp has 'text/html' content type and stop_html.zexp has 'application/octet-stream' content type !!??
Why is that?????
When you upload a file, Zope somehow must determine the "content_type": * if the upload specifies the content type explicitely, it is used * otherwise, if the browser reports one, it is used * otherwise, it is guessed guessed based on extension and content. Apparently, something went wrong in your case. Either correct the "content_type" manually or check who is responsible (browser or guess). If the guess is wrong, then from Zope2.7 on, you can add additional "mime_type" declarations that control content type guessing. -- Dieter
participants (2)
-
Dieter Maurer -
Dragos Chirila