workflow_script
workflow_script copied to clipboard
Move File to new Location
Hi, can someone help me, I want to combine PDF Converter and External Script. So i Upload or Update and Word File. This is converted to PDF and then the PDF needs to be copyed to a new location.
Did someone got this copy part done allready?
I am close to depression, I dont get it why this is not working. I 100 times checked spelling move location. Allways this error? Any suggestions?

Translation for other contributors: "The supplied regular expression is invalid".
@phil16727 Your screenshot is missing the regular expression, that is supposed to be invalid. The regular expression is the text used to filter to which your should apply. Your screenshot only shows the action taken if the regular expression matches.

Hi @Pingger thanks for the reply. I have an expression. As you can see I tryed a lot. Added sudo sudo -u www-data removed the starting / its allways the same.

Ok found the issue If the Mime-typ is pdf it fails, if it is office it works. Any clue why this happens?


OK, this is actually interesting. You are selecting the predefined "PDF-Documents" Option, but workflow_script doesn't know hat to do with it ...
And just to clarify: The issue is not with script (at the moment). You would get this instead:

I also confirmed, that this issue exists on my instance:

And the most interesting thing: manually setting the value of "Custom mimetype" to "application/pdf" also doesn't work...
For now I have a workaround for you:

Apparently the Dev accidentally treated it as plain text, instead of a regular expression and forget "escaping" the string accordingly
Hi, thanks for the help. Well Indeed you are able to save the script but the script isnt fired up.
Well looks like my script isnt fired at all. Is there any logfile I can check?
OK interesting: It does work for me though ... Keep in mind, that a workflow is only triggered the next time the cronjob is executed...
My Nextcloud Logging tells me this:

And my test job:

Is properly executed, once the cron-job is triggered. /tmp/test.sh:
#!/bin/bash
echo Rename: $1 >> /tmp/test.log;
Output in my test.log:
Rename: /tmp/oc_tmp_rRBGsr-.pdf
Rename: /tmp/oc_tmp_yhkWOn-.pdf
Rename: /tmp/oc_tmp_c4srUq-.pdf
Rename: /tmp/oc_tmp_jWyc82-.pdf
Rename: /tmp/oc_tmp_BfbreM-.pdf
My only guess is, that you are trying to apply the script on files in a "groupfolder" of the groupfolder-extension. It is a known issue, that workflow scripts don't trigger on groupfolders ...
"groupfolder" of the groupfolder-extension <- nightmare why in the world ......
"groupfolder" of the groupfolder-extension <- nightmare why in the world ......
What do you mean? I find the groupfolder-extension very useful! It has really helped getting some projects done, that involve several Terabytes of files being shared between several people, seemingly at random...
@Pingger You are completly right with the benifits of group folders but why in the world are thoose files not triggering the workflow script. Here is the deal at least for me. We have a group of people writing User Manuel so i created a group folder with all docx files. Added a trigger to automatically generate a PDF. Now I want the creation of the PDF in the Group Folder trigger my workflow Script to mv the file to a different folder. This folder is a group folder as well which is accessable by mainly everyone to share the PDF File. Which now I cant since the group folder wont trigger the script.
I ran into the same issue. The "Terabytes" of files are actually video files. The idea was, that upon upload a new "low quality" version would be created by the server, since those uploaded file are losslessly encoded. (So 10 seconds = ~5-50GB, not good for previewing). But I had to fallback to manually using curl to fetch all files and check if a low-quality version already exists, if not create and upload....
Issue, that discusses the groupfolder issue: #38
Is this issue still pending? If it is actually related to #38, then this should be closed.
Or mabye it should be renamed into "PDF MIME-Type not working", as this seems to have been an issue, too.