Re: HTTP_Upload unique files

From: Date: Sat, 02 Oct 2004 21:44:36 +0000
Subject: Re: HTTP_Upload unique files
References: 1 2 3  Groups: php.pear.dev php.pear.general 
Request: Send a blank email to pear-dev+get-33619@lists.php.net to get a copy of this message
I'd love this feature. I guess if you do it and post your code to this list, no one will have objections. I'd love to do that :)
Here are my suggestions, Which I hope anyone would give me feedback: 1) what should the "type" of this naming be? My suggested name is 'uniq_seq' which stands for, unique sequence 2) A new utility function needs to be written '_get_last_sequence($file_path)' This is helpful to get the last sequence number of a base file name e.g $last_seq = _get_last_sequence('userGuide.pdf') if the following files exist in the folder( userGuide[1].pdf, userGuide[5].pdf) the function returns 5 or false if no file exists with the same base name 3) A new utility function _ge_seq_file_name($base_file_name) which automatically adds one to the highest sequence. Returns the final name for the file to be written Regards, Ammar

« previous php.pear.dev (#33619) next »