
I don't know any php (well small bits) so I don't know what all that other stuff is, but I wouldn't use md5, there's no need for it to be secure and 32 characters is a bit long for a prefix imo.
I like the concept, and the speeds but the stripes dont agree with my eyes. bit dizzy, but best of look anyhow
-Kevin
o.o
It's okay, I'm going to use a timestamp to control the file name.
And thanks a lot Kevin![]()
I would use a system like this to check weather the file exists. $file = the file name. $extention = .gif/.png or what ever-
Then save the file as what ever is returnedPHP Code:function checkfile( $file, $extention ) {
$rand = rand( "1000", "100000" );
$filefull = "http://downloadelite.net/files/" . $file . $rand . $extension;
if ( file_exists ( $filefull ) ) {
checkfile( $file, $extension );
}
else {
return $filefull;
}
}
Lets set the stage on fire, and hollywood will be jealous.
Nice idea, will fall back on this is anything should go wrong.
Only thing I would need to add is the 'echo' tag to show text to the user.
Using that would be too slow.
PHP Code:public function randomFilename() {
$rand = time();
$rand2 = rand();
$rand3 = rand() + time() - $rand2;
$rand3 = floor( $rand3 );
$rand = sha1( $rand );
$rand = substr( $rand, 10, 10 );
$string = "$rand2$rand$rand3";
$rand = substr( $string, 5, 15 );
return $rand;
}
The system is fully fledged now!
File names include the first 4 characters of the file, then a random number assortment!
It won't allow any files at all and the files dir no longer has an index.
Whoops, sorted now, moved to a new server, and the Upload Code was missing.
Going to fix directory index soon.
Want to hide these adverts? Register an account for free!