Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
deucecactus  
#1 Posted : Thursday, May 17, 2007 5:01:29 AM(UTC)
deucecactus

Rank: Member

Groups: Member
Joined: 4/4/2007(UTC)
Posts: 6

Does anyone have any advice or suggestions on how to deal with duplicate file names?

Thanks!

Alex Makhov  
#2 Posted : Thursday, May 17, 2007 9:07:23 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups:
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

What do you mean? What problems?

Sincerely yours,

Alex Makhov

UserPostedImage Follow Aurigma on Twitter!

FuckFame.nl  
#3 Posted : Sunday, May 20, 2007 2:50:09 AM(UTC)
FuckFame.nl

Rank: Member

Groups: Member
Joined: 12/22/2006(UTC)
Posts: 13

Hello,

I created a namegenerator which creates unique names.

You could try to use mine:

Code:
function generateKey ($length = 8)
{
  // Start with a blank key
  $keycode = "";

  // define possible chars 
 $possible = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
    
  // set up a counter (to the max length)
  $i = 0; 
    
  // add random chars to $keycode untill the length is done
  while ($i < $length) { 

    // choose random char from $possible
    $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
        
    // Is it double (already in the keycode)? Then change to next!
    if (!strstr($keycode, $char)) { 
      $keycode .= $char;
      $i++;
    }

  }

  // w00t! A keycode! :)
  return $keycode ;


}

That's it.

While uploading, you can play with it!

Code:
FOR EXAMPLE:
$fileName = generateKey(8); // 8 chars. You can change it

Sorry for my English, but the code works ;)

Edited by user Tuesday, December 18, 2007 3:37:12 AM(UTC)  | Reason: Not specified

Eugene Kosmin  
#4 Posted : Sunday, May 20, 2007 5:18:58 PM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 9/19/2006(UTC)
Posts: 505

Was thanked: 41 time(s) in 41 post(s)
Hello,

You can add additional POST field with unique filename through AddField method. For example:

Code:
for (var i = 1; i <= _ImageUploader.getUploadFileCount(); i++)
{
	var filename = getUniqueFilename(...);
	_ImageUploader.AddField("UniqueFilename_" + i, filename);
}

You can use the same approach and on server side.

Edited by user Friday, February 22, 2008 4:11:29 PM(UTC)  | Reason: Not specified

Best regards,

Eugene Kosmin

The Aurigma Development Team

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.