Smanji broj okvirova / koristi adler hash
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
<?php
|
||||
|
||||
function hashedName() {
|
||||
$now = time();
|
||||
$somenumber = rand();
|
||||
return sha1("ojhaa $now $somenumber ojhaaa");
|
||||
function hashedName($fileName) {
|
||||
return mhash(MHASH_ADLER32, $fileName);
|
||||
}
|
||||
|
||||
$target_dir = __DIR__ . "/../slike/";
|
||||
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
|
||||
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
|
||||
$hashed_name = hashedName();
|
||||
$hashed_name = hashedName($target_file);
|
||||
$target_file = $target_dir . $hashed_name . ".$imageFileType";
|
||||
|
||||
$uploadOk = 1;
|
||||
|
||||
Reference in New Issue
Block a user