I have a script to use cURL command in Windows to upload .png and .xlsx files to Dokuwiki server 5.3 instead of using the manual Media Manager
The flow is:
# Use cURL to login Wiki
curl -k --cookie cookie.txt --cookie-jar cookie.txt " \"
https://wiki.jmn.mil/doku.php?id=start&do=login\" --data "sectok="real sectok --data"id=start" --data "do=login" --data "u=usrname" --data-urlencode "p=pwd"
# Use cookie file that has the login information to have cURL uploaded files
curl -k --cookie cookie.txt "
https://wiki.jmn.mil/lib/exe/ajax.php?tab_files=files&tab_details=view&do=media&ns=realns &image=imagefile §ok=<real sectok> &mediaid=realmediaid &call=mediaupload&qqfile=real mediaid &ow=checked" --data-binary @sourceFile
I have multiple files to upload using the flow above with overwrite checked. Everything works well. Files are uploaded as expected. However there is a weird problem. Occasionally and very randomly, the curl upload command return the error message: {"error":"Sorry, username or password was wrong.You don't have permissions to upload files.","ns":"ee25:cl:cl04:tinok"}
Let say I have 20 files to upload, the 1st 4 files are uploaded successfully then the 5th file have the error above, the script continues the job and the rest of files are uploaded successfully.
The script then retried to upload the failed file several times but it gets the same error message. After a period of time which I don't know how long, the script does the job again and that file is uploaded successfully again but it may get the same error for different files.
I appreciate if anyone knows the issue and give me some hint to resolve.
Thank you,