Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move File to new Location #63

Open
phil16727 opened this issue Oct 7, 2020 · 13 comments
Open

Move File to new Location #63

phil16727 opened this issue Oct 7, 2020 · 13 comments

Comments

@phil16727
Copy link

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
Copy link
Author

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

@Pingger
Copy link

Pingger commented Oct 7, 2020

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

@phil16727
Copy link
Author

phil16727 commented Oct 7, 2020

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
Copy link
Author

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

@Pingger
Copy link

Pingger commented Oct 7, 2020

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

@phil16727
Copy link
Author

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

@phil16727
Copy link
Author

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

@Pingger
Copy link

Pingger commented Oct 7, 2020

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

@phil16727
Copy link
Author

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

@Pingger
Copy link

Pingger commented Oct 7, 2020

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

@phil16727
Copy link
Author

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

@Pingger
Copy link

Pingger commented Oct 7, 2020

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

@martin-rueegg
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants