Uploading an Excel file from the local hard drive

173 views
Skip to first unread message

Dan Wellisch

unread,
May 20, 2021, 4:30:09 PM5/20/21
to dotCMS User Group
Hello:

I was trying to find an ElasticSearch example of uploading a file into DOTCMS.

Let's say I have file called artifact4.xlsx on my hard drive found here.: C:\work\apiwork\artifact4.xlsx.

If ElasticSearch can't do it....what is the simplest HTTP Post command that would do it....

Please show an example that is known to work.  

Thanks,

Dan

Dan Wellisch

unread,
May 24, 2021, 10:55:43 AM5/24/21
to dotCMS User Group
Does anyone know how to do this?  I tried the new workflow way and the older deprecated way.  All I get is either a 409 Conflict or 500 error.  I am using the Postman HTTP Client.  Perhaps, I simply need to use the curl command.  

I simply want to upload an Excel spreadsheet to DOTCMS using an HTTP Put or Post.  I was able to push some text content up using Postman but not an Excel spreadsheet.

Thanks in advance!

Dan

Stefan Schinkel

unread,
May 24, 2021, 11:09:50 AM5/24/21
to dot...@googlegroups.com
Dan, how about using WebDav? https://dotcms.com/docs/latest/webdav

Best
Stefan

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/38bdf750-4f0c-40b1-9254-1a533d10c34cn%40googlegroups.com.


--
dotCMS Cloud. Digital Now.

Stefan Schinkel


200 Portland Street, Suite 3.158
Boston MA 02114

Dan Wellisch

unread,
May 25, 2021, 7:07:54 AM5/25/21
to dot...@googlegroups.com
I don't think that is practical.  That looks like a developer tool..mapping folders and placing files.  I need an HTTP request so that a backend can be instructed as directed by a custom UI..

You received this message because you are subscribed to a topic in the Google Groups "dotCMS User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dotcms/g_ADCgbVWe8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAFgBZ02sKuM%3D%2BXUt-QcWB4dLY3CNEMEk3qkumbos%3D8a%2BngZEKQ%40mail.gmail.com.

Falzone, Chris

unread,
May 25, 2021, 9:25:10 AM5/25/21
to dot...@googlegroups.com
I do this with curl.  It's something like ...

curl -s -u MYUSER:MYPASS https://MYSERVER.com/api/content/publish/1 -XPUT \
  -F 'json={stName:"fileAsset",hostFolder:"'"site-in-dotcms.com:/folder/path/"'",title="'"thefile.txt"'",languageId:1};type=application/json' \
  -F file=@"/local/file/path/thefile.txt"


Escaping is a pain ..  I suggest using some scripting language like bash/node/python if it's something you do regularly.  Note this is using the older API, I haven't updated my scripts for the latest version to use the newer workflow api so I am not sure this works in the latest version, but using the workflow api would be the same, just different url and json data you are passing to it.

Hope that helps.



--

Christopher Falzone

DevOps Engineer

A Q U E N T  /  VITAMIN T

Mark Pitely

unread,
May 25, 2021, 9:38:58 AM5/25/21
to dot...@googlegroups.com
If you use a structure with a binary file field, you can build/serve 'files' as content. To be honest, I think that's how dotCMS handles them internally now.
This would mean the file exists as a blob in the db rather than as a file in a filesystem. In many ways, this is far superior to having 'files'. (You can programmatically flip through them, and have whatever metadata you like)
Here's an example of some js that uploads content with a file attached - this is using it from an html form to handle the uploading but you could do it anyway you like:


function saveeblock(){
var date = new Date();    
   
var title=document.getElementById('title').value;
var caption=document.getElementById('caption').value;
var imagedescription=document.getElementById('imagedescription').value;
var url=document.getElementById('url').value;
var turl=document.getElementById('turl').value;
var body=document.getElementById('body').value;
var tag=document.getElementById('tag').value;
var video=document.getElementById('video').value;
var department=document.getElementById('department').value;
var buttontext=document.getElementById('buttontext').value;  
var buttonurl=document.getElementById('buttonurl').value;  
var today=date.getMonth()+1;    
var postdate=today+'/'+date.getDate()+'/'+date.getFullYear();
var formData = new FormData()
request = new XMLHttpRequest();
request.onreadystatechange = function() {
 
  if (request.readyState == 4){
        if (request.status === 200) {  
            var a = request.getAllResponseHeaders();
            console.log(a);
           
            where=a.indexOf('identifier: ');
      id=a.slice(where+12,where+48);
    console.log("Identifier:",id,"!");
           
       insertblock(id,row,identifier1,identifier2);    
           
           
        } else {  
           console.log("Error", request.statusText);  
        }  
 
}
   
 

};

request.open("POST", "/api/content/publish/1", true);  
 var dataObj={
          'stName':'Eiffelblock',
          'title': title,
          'caption': caption,
          'imagedescription': imagedescription,
          'url' : turl,
          'body' : body,
          'tag' : tag,
          'video' : video,
          'buttontext' : buttontext,
          'buttonurl' : buttonurl,
          'department' : department,
          'postdate' : postdate,        
          'contentHost':'SYSTEM_HOST'};    
console.log(dataObj);    
   
formData.append('json',JSON.stringify(dataObj));  
var theimager=document.getElementById('tpic');

var file=theimager.files[0];
formData.append("image", file);
  
 request.send(formData);
}

Mark Pitely
Marywood University


Falzone, Chris

unread,
May 25, 2021, 9:59:44 AM5/25/21
to dot...@googlegroups.com
Heh, I was just going through my scripts folder and found something where I was using Node JS and FormData -- might be helpful, but Mark beat me to it: 
https://gist.github.com/cfalzone/a07032dca6166c503e574a0ef95ab1c1

jonathan...@dotcms.com

unread,
May 25, 2021, 6:16:37 PM5/25/21
to dotCMS User Group
hi Dan, this is the postman code generated:

--form 'json="{\"contentlet\":
{
\"contentType\":\"FileAsset\",
\"fileName\":\"GraphQLTests.json\",
\"title\":\"GraphQLTests.json\",
\"hostFolder\":\"default\"
}
}";type=application/json' \
--form 'file=@"/Users/jsanca/gitsources/new-core/core/dotCMS/src/curl-test/GraphQLTests.json"'


I am using a form data on postman looks like:
Screen Shot 2021-05-25 at 4.14.56 PM.png

Dan Wellisch

unread,
Jun 8, 2021, 6:35:32 PM6/8/21
to dotCMS User Group
Hi Jonathan:

I am struggling with this....I tried to model a sample from what you gave me below....

I don't see my file artifact6.xlsx being published to DotCMS.  What am I missing?  Do I need to create a Scheme, Step, and Action for this that is 
not the default?  I got confused by the documentation on how to do this....

Here is mine.:

curl  --location --request  PUT 'https://<hostname>/api/v1/workflow/actions/default/fire/PUBLISH' \
     -H 'Authorization: Bearer <token>' \                                                                                                            --form 'json="{\"contentlet\":
        {
                \"contentType\":\"FileAsset\",
                \"fileName\":\"artifact6.xlsx\",
                \"title\":\"artifact6.xlsx\",
                \"hostFolder\":\"<hostname>\"
        }
}";type=application/json' \
        --form 'file=@"/home/dwellisch/ApiCallsBash/workflows/artifact6.xlsx"'

Dan Wellisch

unread,
Jun 9, 2021, 10:47:54 AM6/9/21
to dotCMS User Group

I also tried replacing PUBLISH with NEW and still I don't see any content uploaded and there is no error message from the curl command.

jonathan...@dotcms.com

unread,
Jun 9, 2021, 11:40:28 AM6/9/21
to dotCMS User Group
hi Dan,

Not sure why is not working, I would check which workflow is assigned to FileAsset to double check if the System Workflow is assigned to that content type.

Best,
J

Dan Wellisch

unread,
Jun 10, 2021, 5:57:23 PM6/10/21
to dotCMS User Group

Jonathan:

I honestly don't know why this is so hard to get going...Is this some paid support that we might need?  How can you help us fix this quickly?

Here is an exact copy of your documentation.

Uploading a Single Binary File

The following curl command submits a single binary image to a File Asset type of content using the REST API. Note the JSON portion of the API call to set the regular field values, and the file included using @ (which will submit the specified file to the first Binary field in the Content Type).

curl --location --request PUT 'http://localhost:8080/api/v1/workflow/actions/default/fire/NEW?language=1589383514071' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic XXXXXXXXXXXXXXXXX==' \ --form 'file=@testpdf.pdf' \ --form 'json={ "contentlet": { "contentType":"PDFDotAsset", "title":"Test1", "contentHost":"demo.dotcms.com" } } '


And here is my script....I made sure that the TestFile content type (which I created as a File Asset) had the System Workflow assigned.  What else do I need to do?  What dotCMS logs can I look at to see what the problem is?  Is there a test site that you have that I can use to try this out on?  Perhaps something is wrong with our installation? 
********my bash script********
curl --location --request PUT '<https://host path>/api/v1/workflow/actions/fire/NEW' \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <token>' \
        --form 'json={"contentlet":
        {
                "contentType":"TestFile",
                "title":"artifact6.xlsx",
                "contentHost":"<host path>"
        }' \
        --form 'file=@/home/dwellisch/ApiCallsBash/workflows/artifact6.xlsx'
***************
Here is the dotCMS environment information:

Version: 5.1.6 (June 06, 2019)
 
Environment Variable     Value  
CATALINA_PID
/tmp/dotcms.pid
HOME
/home/dotcms
JAVA_HOME
/opt/jdk1.8.0_221
JAVA_OPTS
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -Djava.awt.headless=true -Xverify:none -Dfile.encoding=UTF8 -server -XX:+DisableExplicitGC -XX:MaxMetaspaceSize=512m -Xmx5G -XX:+UseG1GC -javaagent:/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32/webapps/ROOT/WEB-INF/lib/byte-buddy-agent-1.6.12.jar -Dsun.jnu.encoding=UTF-8 -Ddotserver=dotcms -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
JDK_JAVA_OPTIONS
--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
LANG
en_US.UTF-8
LOGNAME
dotcms
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
PIDFile
/tmp/dotcms.pid
PWD
/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32/webapps/ROOT
SHELL
/sbin/nologin
SHLVL
1
USER
dotcms
WorkingDirectory
/datavol_dotcms/dotcms
_
/opt/jdk1.8.0_221/bin/java
 
PropertyValue
Startup Args
-Djava.util.logging.config.file=/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
-Djava.awt.headless=true
-Xverify:none
-Dfile.encoding=UTF8
-XX:+DisableExplicitGC
-XX:MaxMetaspaceSize=512m
-Xmx5G
-XX:+UseG1GC
-javaagent:/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32/webapps/ROOT/WEB-INF/lib/byte-buddy-agent-1.6.12.jar
-Dsun.jnu.encoding=UTF-8
-Ddotserver=dotcms
-Djdk.tls.ephemeralDHKeySize=2048
-Djava.protocol.handler.pkgs=org.apache.catalina.webresources
-Dorg.apache.catalina.security.SecurityListener.UMASK=0027
-Dignore.endorsed.dirs=
-Dcatalina.base=/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32
-Dcatalina.home=/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32
-Djava.io.tmpdir=/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32/temp

DOTCMS_LOGGING_HOME
/opt/dotcms/dotsecure/logs

DotResourceLoader.resource.loader.cache
true

DotResourceLoader.resource.loader.class
com.dotcms.rendering.velocity.services.DotResourceLoader

DotResourceLoader.resource.loader.modificationCheckInterval
0

HTTPVanityURL.regexp.pattern
^/?([a-zA-Z0-9,.\-_:'"’\[\]() @%\*]*/?)*$

Log4jContextSelector
org.apache.logging.log4j.core.async.AsyncLoggerContextSelector

RoleName.regexp.pattern
^(?!.*[>|<|\t|\n|\r|\f].*)

UserName.regexp.pattern
^(?!.*[>|<|\t|\n|\r|\f].*)

awt.toolkit
sun.awt.X11.XToolkit

catalina.base
/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32

catalina.home
/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32

catalina.useNaming
true

com.dotcms.repackage.com.zaxxer.hikari.pool_number
2

com.liferay.filters.compression.CompressionFilter
false

com.liferay.filters.compression.CompressionFilter.encoding
UTF-8

com.liferay.util.Xss.regexp.pattern
.*(?i)<[s]*/?[s]*script.*?|.*<[s]*/?[s]*iframe.*?|.*<[s]*/?[s]*frame.*?|.*<[s]*/?[s]*meta.*?|<.*?javascript:|<[s]*?body.*?onload|.*<[s]*/?[s]*embed.*?|.*<[s]*/?[s]*object.*?|.*<[s]*a[s]*href[^>]*javascript[s]*:[^(^)^>]*[(][^)]*[)][^>]*>[^<]*(<[s]*/[s]*a[^>]*>).*|.*?javascript:.*|.*<.*(;|=).*?|.*\{*.\}.*?

com.liferay.util.servlet.UploadServletRequest.max.size
-1

common.loader
"${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar"

directive.if.tostring.nullcheck
false

directive.parse.max.depth
100

dotcms.started.up
true

dotcms.startup.cache.ms
152

dotcms.startup.db.ms
891

dotcms.startup.es.ms
9483

dotcms.startup.hazel.ms
1418

dotcms.startup.ms
2941042156

dotcms.startup.osgi.ms
1765

dotcms.startup.quartz.ms
46

dotserver
dotcms

eventhandler.methodexception.class
com.dotcms.rendering.velocity.events.MethodExceptionEventHandlerImpl

eventhandler.nullset.class
com.dotcms.rendering.velocity.events.NullSetEventHandlerImpl

felix.osgi.enabled
true

file.encoding
UTF-8

file.encoding.pkg

file.separator
/

hibernate.cache.provider_class
com.dotmarketing.db.NoCacheProvider

hibernate.cglib.use_reflection_optimizer
false

hibernate.configs
META-INF/counter-hbm.xml,META-INF/portal-hbm.xml

hibernate.connection.datasource
jdbc/LiferayPool

hibernate.connection.provider_class
com.liferay.util.dao.hibernate.DSConnectionProvider

hibernate.dialect
com.liferay.util.dao.hibernate.DynamicDialect

hibernate.jdbc.batch_size
0

hibernate.jdbc.use_scrollable_resultset
true

hibernate.show_sql
false

hibernate.statement_cache.size
0

ignore.endorsed.dirs

input.encoding
UTF-8

java.awt.graphicsenv
sun.awt.X11GraphicsEnvironment

java.awt.headless
true

java.awt.printerjob
sun.print.PSPrinterJob

java.class.path
/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32/bin/bootstrap.jar:/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32/bin/tomcat-juli.jar:/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32/webapps/ROOT/WEB-INF/lib/byte-buddy-agent-1.6.12.jar

java.class.version
52.0

java.endorsed.dirs
/opt/jdk1.8.0_221/jre/lib/endorsed

java.ext.dirs
/opt/jdk1.8.0_221/jre/lib/ext:/usr/java/packages/lib/ext

java.home
/opt/jdk1.8.0_221/jre

java.io.tmpdir
/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32/temp

java.library.path
/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

java.naming.factory.initial
org.apache.naming.java.javaURLContextFactory

java.naming.factory.url.pkgs
org.apache.naming

java.net.preferIPv4Stack
true

java.protocol.handler.pkgs
org.apache.catalina.webresources

java.runtime.name
Java(TM) SE Runtime Environment

java.runtime.version
1.8.0_221-b11

java.specification.name
Java Platform API Specification

java.specification.vendor
Oracle Corporation

java.specification.version
1.8

java.util.concurrent.ForkJoinPool.common.threadFactory
org.apache.catalina.startup.SafeForkJoinWorkerThreadFactory

java.util.logging.config.file
/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32/conf/logging.properties

java.util.logging.manager
org.apache.juli.ClassLoaderLogManager

java.vendor
Oracle Corporation

java.vendor.url

java.vendor.url.bug

java.version
1.8.0_221

java.vm.info
mixed mode

java.vm.name
Java HotSpot(TM) 64-Bit Server VM

java.vm.specification.name
Java Virtual Machine Specification

java.vm.specification.vendor
Oracle Corporation

java.vm.specification.version
1.8

java.vm.vendor
Oracle Corporation

java.vm.version
25.221-b11

jdk.tls.ephemeralDHKeySize
2048

jna.loaded
true

jnidispatch.path
/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32/temp/jna--1325986976/jna6362248813862941393.tmp

line.separator

org.apache.catalina.security.SecurityListener.UMASK
0027

org.apache.tomcat.util.digester.PROPERTY_SOURCE
com.dotcms.tomcat.context.TomcatPropertyDecoder

org.apache.xml.security.ignoreLineBreaks
true

org.quartz.threadPool.makeThreadsDaemons
true

os.arch
amd64

os.name
Linux

os.version
3.10.0-957.27.2.el7.x86_64

output.encoding
UTF-8

package.access
sun.,org.apache.catalina.,org.apache.coyote.,org.apache.jasper.,org.apache.tomcat.

package.definition
sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.jasper.,org.apache.naming.,org.apache.tomcat.

path.separator
:

resource.loader
DotResourceLoader

resource.manager.cache.class
com.dotcms.rendering.velocity.services.DotResourceCache

runtime.introspector.uberspect
org.apache.velocity.util.introspection.SecureUberspector

runtime.log.logsystem.class
com.dotmarketing.util.DotVelocityLogger

server.loader

shared.loader

sun.arch.data.model
64

sun.boot.class.path
/opt/jdk1.8.0_221/jre/lib/resources.jar:/opt/jdk1.8.0_221/jre/lib/rt.jar:/opt/jdk1.8.0_221/jre/lib/sunrsasign.jar:/opt/jdk1.8.0_221/jre/lib/jsse.jar:/opt/jdk1.8.0_221/jre/lib/jce.jar:/opt/jdk1.8.0_221/jre/lib/charsets.jar:/opt/jdk1.8.0_221/jre/lib/jfr.jar:/opt/jdk1.8.0_221/jre/classes

sun.boot.library.path
/opt/jdk1.8.0_221/jre/lib/amd64

sun.cpu.endian
little

sun.cpu.isalist

sun.font.fontmanager
sun.awt.X11FontManager

sun.io.unicode.encoding
UnicodeLittle

sun.java.command
org.apache.catalina.startup.Bootstrap start

sun.java.launcher
SUN_STANDARD

sun.jnu.encoding
UTF-8

sun.management.compiler
HotSpot 64-Bit Tiered Compilers

sun.nio.ch.bugLevel

sun.os.patch.level
unknown

tomcat.util.buf.StringCache.byte.enabled
true

tomcat.util.scan.StandardJarScanFilter.jarsToScan
log4j-web*.jar,log4j-taglib*.jar,log4javascript*.jar,slf4j-taglib*.jar

tomcat.util.scan.StandardJarScanFilter.jarsToSkip
bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,websocket-api.jar,jaspic-api.jar,catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-storeconfig.jar,catalina-tribes.jar,jasper.jar,jasper-el.jar,ecj-*.jar,tomcat-api.jar,tomcat-util.jar,tomcat-util-scan.jar,tomcat-coyote.jar,tomcat-dbcp.jar,tomcat-jni.jar,tomcat-websocket.jar,tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,tomcat-juli-adapters.jar,catalina-jmx-remote.jar,catalina-ws.jar,tomcat-jdbc.jar,tools.jar,commons-beanutils*.jar,commons-codec*.jar,commons-collections*.jar,commons-dbcp*.jar,commons-digester*.jar,commons-fileupload*.jar,commons-httpclient*.jar,commons-io*.jar,commons-lang*.jar,commons-logging*.jar,commons-math*.jar,commons-pool*.jar,jstl.jar,taglibs-standard-spec-*.jar,geronimo-spec-jaxrpc*.jar,wsdl4j*.jar,ant.jar,ant-junit*.jar,aspectj*.jar,jmx.jar,h2*.jar,hibernate*.jar,httpclient*.jar,jmx-tools.jar,jta*.jar,log4j*.jar,mail*.jar,slf4j*.jar,xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,junit.jar,junit-*.jar,hamcrest-*.jar,easymock-*.jar,cglib-*.jar,objenesis-*.jar,ant-launcher.jar,cobertura-*.jar,asm-*.jar,dom4j-*.jar,icu4j-*.jar,jaxen-*.jar,jdom-*.jar,jetty-*.jar,oro-*.jar,servlet-api-*.jar,tagsoup-*.jar,xmlParserAPIs-*.jar,xom-*.jar,jcifs.jar

user.country
US

user.dir
/datavol_dotcms/dotcms/dotserver/tomcat-8.5.32/webapps/ROOT

user.home
/home/dotcms

user.language
en

user.name
dotcms

user.timezone
Etc/UCT

userdirective
com.dotcms.enterprise.velocity.CacheBlockDirective,com.dotcms.enterprise.velocity.CacheInvalidateLineDirective,com.dotcms.enterprise.velocity.InlineEditLineDirective

velocimacro.library
VM_global_library.vm,dotCMS_library.vm,dotCMS_library_ext.vm

velocimacro.library.autoreload
false

velocimacro.permissions.allow.inline.to.replace.global
true                                        

jonathan...@dotcms.com

unread,
Jun 10, 2021, 8:53:19 PM6/10/21
to dotCMS User Group
Couple things, I think you are a curly bracket, so the json may be not well-formatted.
I would go to maintenance to check if there is any log
Best,


Dan Wellisch

unread,
Jun 14, 2021, 10:54:05 AM6/14/21
to dotCMS User Group
Jonathan:  It seems I needed to a folder name to the URL I had....Once I do that, I get the following....I checked all the permissions....don't see an issue with my authorization token.

Are you sure the correct Authorization format should be.:

     --header 'Authorization: Bearer <token>' \

?

#logo {
  float: left;
}

#text {
  float: left;
}
</style>



</head>
<body>
  <div id="main">
    <div id="text">

      <h1>dotCMS: 403 Forbidden</h1>

      <p>You do not have permissions to view the Page or file you were looking for.<br/>(If you are logged in, please contact your administrator for access).</p>

    </div>
  </div>
</body>
</html>0

Dan Wellisch

unread,
Jun 17, 2021, 5:15:47 PM6/17/21
to dot...@googlegroups.com
Jonathan:

Well, I fixed the curly brace.  That did not help, although I thought it would.  Also, there are no maintenance logs.
Can you do something for me?  

Pretend I am a complete novice...which I am.  Step-by-step, would you have me do from the very beginning to the end?

Tell me exactly what action/step I need to use on the System Workflow...please take screenshots of yours and show me.  I know this might be asking a lot, but I think you could use this as a piece of your documentation on your site to help others...

My only other option is paying for support and I would do that out of my own pocket, if I needed to....I just need to get some understanding of how this works and to actually see it work...

I have had too much time being frustrated with it not working, but by not seeing any logging of what is not working.  My curl command is always returning a success code. :(

Dan

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to a topic in the Google Groups "dotCMS User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dotcms/g_ADCgbVWe8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dotcms+un...@googlegroups.com.


--
Dan Wellisch, President 
Wellisch Software Technologies, Inc.

joan Varnavant

unread,
Feb 16, 2024, 7:15:49 AMFeb 16
to dotCMS User Group
Hi everyone, 

apologize to digging out this thread but actually and after few week of work I kind of have exactly the same issue.
Since this thread has two year, does this problem has been solve or is it still the same.
Actually every put using workflow api still generate an error 400, 403, 405 but no matter it has no way to make it work.

Kind regards.
Joan Varnavant

Mark Pitely

unread,
Feb 16, 2024, 9:23:40 AMFeb 16
to dot...@googlegroups.com
Joan (and Dan),
If you dig through the response data, there is often a text message that will help clear the issue. It will explain why you are getting the 405, etc. I was getting a 'Expect JSON Array' error message, so I tweaked my json to enable an array with a couple extra brackets - it is not necessarily expecting 'true' json (a further reminder that json is a pretty flaky standard). Also, in the example bash, looks like you are missing a trailing brace. In general, you can almost always remove the 'host' fields unless you have a multihost setup. 
Lastly, Dan was using 5.19, so I am not sure any of this would work. 
So this:
        --form 'json={"contentlet":
        {
                "contentType":"TestFile",
                "title":"artifact6.xlsx",
                "contentHost":"<host path>"
        }' \   <----you closed the contentlet but not the json. 
becomes:
    --form 'json={"contentlet":
        [{
                "contentType":"TestFile",
                "title":"artifact6.xlsx",
                "contentHost":"<host path>"
        }]}' \

Here's an example in javascript that works for me:
var dataObj={"contentlet":[{"identifier":id,"paid":"pending","contentType":"TexplStudent"}]};


Mark Pitely 
Albright College

--
http://www.dotcms.com - Open Source headless/hybrid CMS
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b59bca10-75e9-4d8a-860f-12bb9b1f32bdn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages