134 Posts
root
6 years ago
Topic

Hello,

I need to execute a shell command on after store (shell_exec). First, I think I need to buy the Code Pack (5 plug-ins) and then (here is where I don't know how) execute this command referring to a uploaded document by an upload_field:

"pdftk /some/path/the_uploaded_file.pdf stamp /some/path/watermark.pdf output /some/path/the_uploaded_file.pdf"

This is the command I need to execute in order to create a watermark between two pdf files, the original and the watermark itself.

Any help will be much appreciated.
Best regards.

Get a Book for SEBLOD
4229 Posts
Kadministrator
6 years ago
3
Level 1

To use code pack you need to know php programming. To execute php function you can write it in the field configuration or put it the file loaded by the code field. 

134 Posts
root
6 years ago
2
Level 2

I have enough knowledge of php, I have written several joomla modules and plugins, but this not involves to know how can I properly refer to an uploaded file with Seblod.

4229 Posts
Kadministrator
6 years ago
1
Level 3

Probably the easiest way to do this would be to duplicate file upload field under a different name and do changes directly in that field 

134 Posts
root
6 years ago
0
Level 4

Eer well, not sure... Thank you for your time, Klas.

$fields['upload_file_name']->value or text or link or hits or any of its attributes

Best regards

4229 Posts
Kadministrator
6 years ago
1
Level 1

If you will try to use afterstore you need to be careful about plugin order as upload field also does actual uploading in afterstore event.

134 Posts
root
6 years ago
0
Level 2

Thank you, that's a smart advice.

I'll keep it in mind while I test the functionality

Greetings

Get a VIP membership