Names of uploaded file

QuestionsNames of uploaded file
Davor Budimir asked 6 years ago

Hello Abu,

How to change name of uploaded file so that it does not happen copying one over the other (in the case of the same names).

// file upload column
$col = array();
$col["title"] = "Note";
$col["name"] = "note";
$col["width"] = "250";
$col["editable"] = true;
$col["edittype"] = "file";
$col["upload_dir"] = "files_dir";
$cols[] = $col;

Best regards,
Davor Budimir

1 Answers
Abu Ghufran answered 6 years ago

You can extend on_update event (as in sample) and use rename function to change saved file name on update.

function update_invoice($data)
{
$upload_file_path = $data["params"]["note"];
// use rename() ………..
}

Your Answer

20 + 16 =

Login with your Social Id:

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:

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

Let us improve this post!