Fix to issue with file encoding/mimetype not being set on file upload

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7267 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast 2007-10-31 16:02:50 +00:00
parent 3e65d317a7
commit ae37e5c139

View File

@ -1211,7 +1211,10 @@ public class ScriptNode implements Serializable, Scopeable
reset(); reset();
return newInstance(fileInfo.getNodeRef(), this.services, this.scope); ScriptNode file = newInstance(fileInfo.getNodeRef(), this.services, this.scope);
file.setMimetype(this.services.getMimetypeService().guessMimetype(name));
return file;
} }
/** /**
@ -2370,6 +2373,15 @@ public class ScriptNode implements Serializable, Scopeable
return contentData.getEncoding(); return contentData.getEncoding();
} }
public void setEncoding(String encoding)
{
this.contentData = ContentData.setEncoding(this.contentData, encoding);
services.getNodeService().setProperty(nodeRef, this.property, this.contentData);
// update cached variables after putContent()
this.contentData = (ContentData) services.getNodeService().getProperty(nodeRef, this.property);
}
public void setMimetype(String mimetype) public void setMimetype(String mimetype)
{ {
this.contentData = ContentData.setMimetype(this.contentData, mimetype); this.contentData = ContentData.setMimetype(this.contentData, mimetype);