workflow_script icon indicating copy to clipboard operation
workflow_script copied to clipboard

Move File to new Location

Open phil16727 opened this issue 5 years ago • 13 comments

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?

phil16727 avatar Oct 07 '20 09:10 phil16727

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?

image

phil16727 avatar Oct 07 '20 12:10 phil16727

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.

image

Pingger avatar Oct 07 '20 12:10 Pingger

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.

image

phil16727 avatar Oct 07 '20 12:10 phil16727

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

image

image

phil16727 avatar Oct 07 '20 12:10 phil16727

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: image

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

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:

image

Apparently the Dev accidentally treated it as plain text, instead of a regular expression and forget "escaping" the string accordingly

Pingger avatar Oct 07 '20 13:10 Pingger

Hi, thanks for the help. Well Indeed you are able to save the script but the script isnt fired up.

phil16727 avatar Oct 07 '20 13:10 phil16727

Well looks like my script isnt fired at all. Is there any logfile I can check?

phil16727 avatar Oct 07 '20 13:10 phil16727

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: image

And my test job: image

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 ...

Pingger avatar Oct 07 '20 13:10 Pingger

"groupfolder" of the groupfolder-extension <- nightmare why in the world ......

phil16727 avatar Oct 07 '20 14:10 phil16727

"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 avatar Oct 07 '20 14:10 Pingger

@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.

phil16727 avatar Oct 07 '20 14:10 phil16727

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

Pingger avatar Oct 07 '20 14:10 Pingger

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.

martin-rueegg avatar Aug 03 '22 11:08 martin-rueegg