At this point, I don't know enough about what you are trying to accomplish to provide very much guidance. I would encourage you to start by taking a look at the $FILES array to see how it's organized:
var_dump($_FILES["files"]);
Once you see how it is structured, you should have a better idea of what kind of data you are looking at. As I mentioned in my last post, I think your loop is not constructed properly. Are you getting any errors with your code?
There are a handful of coding practices in this script that look a little suspect to me. For example, you define where you are going to put these images by letting the user specify the path via $POST["StockNo"]:
$WebDir = ucfirst($_POST['StockNo']);
$WebImagePath = "../item_images/web/".$WebDir."/";
Since $_POST data comes from user input, you should validate/sanitize/filter that data before you simply start writing files in some arbitrary location or you might find that hackers are over-writing important files on your server.
This code also looks pretty confused to me:
if(is_dir($desired_dir)==false){
mkdir("$desired_dir", 0700);
}
if(is_dir("$desired_dir/".$file_name)==false){
move_uploaded_file($file_tmp,"$desired_dir/".$file_name);
}else{
$new_dir="$desired_dir/".$file_name.time();
rename($file_tmp,$new_dir) ;
}
mysql_query($query);
In particular, you throw in mysql_query in there and you haven't bothered to define $query or even connect to a database. $desired_dir is defined from unfiltered/unvalidated user input as I just described, and you are also relying on user input for $file_name which could be anything under the sun and is also not safe.