Names of uploaded file

QuestionsNames of uploaded file
Davor Budimir asked 11 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 11 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

8 + 15 =

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?