HOW TO set unique value for uploaded image

Talk and info about common issues

Moderator: alexandrleonenko

administrator
Site Admin
Site Admin
Posts: 6098
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO set unique value for uploaded image

Postby administrator » Apr 23rd, '09, 20:06

There are 2 way to set unique value for uploaded image.
You just need to write these attributes in your image field (use $_POST for PoaskBack methods POST/AJAX):

Option 1:
1) "file_name"=>"img_".((isset($_GET['prfx_mode']) && ($_GET['prfx_mode'] == "add")) ? $dgrid->GetNextId() : $dgrid->GetCurrentId())

Option 2:
2) "file_name"=>"img_".((isset($_GET['prfx_mode']) && ($_GET['prfx_mode'] == "add")) ? $dgrid->GetRandomString("10") : $dgrid->GetCurrentId())

Return to “ApPHP DataGrid {HOW TO}”