diff --git a/src/DocumentLibrary/DocumentStore.py b/src/DocumentLibrary/DocumentStore.py index bb6eae4..726caeb 100644 --- a/src/DocumentLibrary/DocumentStore.py +++ b/src/DocumentLibrary/DocumentStore.py @@ -365,7 +365,7 @@ # Set the properties, but don't index yet doc.manage_changeProperties(REQUEST, reindex=0) # See if a file or url was specified - if not REQUEST.file.filename and REQUEST.get('url', 'http://') != 'http://': + if hasattr(REQUEST.file, 'filename') and (not REQUEST.file.filename and REQUEST.get('url', 'http://') != 'http://'): doc.manage_upload(file=REQUEST.url, remote=1) else: doc.manage_upload(REQUEST.file) @@ -373,7 +373,7 @@ if not Document.check_content_type(self, doc.content_type): self.manage_delObjects(doc.getId()) raise "IllegalFileType", \ - "That file type cannot be uploaded into the library." + "Files of type '%s' cannot be uploaded into the library." % doc.content_type return doc