|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -# $Id: cgi_client.py,v 1.25 2001-08-29 05:30:49 richard Exp $ |
| 18 | +# $Id: cgi_client.py,v 1.26 2001-09-12 08:31:42 richard Exp $ |
19 | 19 |
|
20 | 20 | import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes |
21 | 21 |
|
@@ -395,9 +395,11 @@ def newfile(self, message=None): |
395 | 395 | if [i for i in keys if i[0] != ':']: |
396 | 396 | try: |
397 | 397 | file = self.form['content'] |
| 398 | + type = mimetypes.guess_type(file.filename)[0] |
| 399 | + if not type: |
| 400 | + type = "application/octet-stream" |
398 | 401 | self._post_editnode(cl.create(content=file.file.read(), |
399 | | - type=mimetypes.guess_type(file.filename)[0], |
400 | | - name=file.filename)) |
| 402 | + type=type, name=file.filename)) |
401 | 403 | # and some nice feedback for the user |
402 | 404 | message = '%s created ok'%cn |
403 | 405 | except: |
@@ -513,6 +515,9 @@ def parsePropsFromForm(cl, form, nodeid=0): |
513 | 515 |
|
514 | 516 | # |
515 | 517 | # $Log: not supported by cvs2svn $ |
| 518 | +# Revision 1.25 2001/08/29 05:30:49 richard |
| 519 | +# change messages weren't being saved when there was no-one on the nosy list. |
| 520 | +# |
516 | 521 | # Revision 1.24 2001/08/29 04:49:39 richard |
517 | 522 | # didn't clean up fully after debugging :( |
518 | 523 | # |
|
0 commit comments