Change file name when upload.

QuestionsChange file name when upload.
ALÉN asked 2 years ago

Hello,

I want to change the name of the file when I upload it. Can I create a new name for the file somewhere ?

The col code:

$col = array();
$col["title"] = "Picture1";
$col["name"] = "Picture1";
$col["align"] = "left";
$col["width"] = "12"; /
$col["editable"] = true;
$col["edittype"] = "file";
$col["upload_dir"] = $files;
$col["show"] = array("list" => false, "edit" => true, "add" => true);
$cols[] = $col;

Thank you.

2 Answers
Abu Ghufran answered 2 years ago

You need to use on_insert / on_update event handler and rename file there.
For demo code, refer demos/editing/file-upload.php

Alén answered 2 years ago

Right, my fault. Thank you.

Your Answer

15 + 18 =

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!