Image Upload-Set custom name of image

QuestionsImage Upload-Set custom name of image
Rankaj asked 10 years ago

Hello Abu,

I want to customize the image names that are uploading into “uploads” folder. Currently its storing image names like ”<imageName_1.jpg>,<imageName_2.jpg> etc”

Can I set parameter “$col["imageNameToBeStored "]” like below to set the dynamic names like “148989889890.jpg”

$col = array();
$col["title"] = "Image";
$col["name"] = "news_image";
$col["editable"] = true;
$col["edittype"] = "file"; // render as file
$col["upload_dir"] = "uploads/news_images"; // upload here

//Requirement

$col["imageNameToBeStored"] = time()."news_image";

time() is php time function to generate random number.

Thanks

Your Answer

17 + 19 =

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?