无法使用Curl将文件上传到Alfresco

时间:2014-01-03 11:30:59

标签: alfresco alfresco-share

我有一个php脚本,使用curl将文件上传到Alfresco,它可以在我的系统上使用Alfresco本地设置。但是,当使用相同内容上传到生产副本时失败。

下面是上传文件时失败时的卷曲响应,

{
  "status" :
{
  "code" : 500,
  "name" : "Internal Error",
  "description" : "An error inside the HTTP server which prevented it from fulfilling the request."
},

"message" : "00031437 Unexpected error occurred during upload of new content.",
"exception" : "org.springframework.extensions.webscripts.WebScriptException - 00031437 Unexpected error occurred during upload of new content.",

"callstack" :
[
   ""      ,"java.lang.IllegalArgumentException: Class {}application\/pdf has not been defined in the data dictionary"
  ,"org.alfresco.repo.policy.ClassPolicyDelegate.get(ClassPolicyDelegate.java:98)"
  ,"org.alfresco.repo.policy.ClassPolicyDelegate.get(ClassPolicyDelegate.java:83)"
  ,"org.alfresco.repo.node.AbstractNodeServiceImpl.invokeBeforeCreateNode(AbstractNodeServiceImpl.java:283)"
  ,"org.alfresco.repo.node.db.DbNodeServiceImpl.createNode(DbNodeServiceImpl.java:363)"
  ,"sun.reflect.GeneratedMethodAccessor1147.invoke(Unknown Source)"
  ,"sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)"
  ,"java.lang.reflect.Method.invoke(Method.java:606)"
  ,"org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)"
  ,"org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)"
  ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)"
  ,"org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:104)"
  ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)"
  ,"org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)"
  ,"com.sun.proxy.$Proxy9.createNode(Unknown Source)"
  ,"sun.reflect.GeneratedMethodAccessor1147.invoke(Unknown Source)"
  ,"sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)"
  ,"java.lang.reflect.Method.invoke(Method.java:606)"
  .
  .
  .
}

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

contenttype的值必须是有效的qname类型。请查看http://WEBURL:8000/alfresco/service/index/uri/api/upload处的文档。如有疑问,请尝试cm:content或完全代表。