<?php
$fileName = basename( $_FILES['fileName']['name']);
//count current total files
$dir_path = "snaps/";
$count = count(glob($dir_path . "*"));
$newFileName = $count . ".jpg";
$target_path = "snaps/" . $newFileName;
if(move_uploaded_file($_FILES['fileName']['tmp_name'], $target_path)) {
echo "<br/>Success";
else{
echo "<br />Failed";
}
?>
The above works in my unix like server
(Linux server.nixism.com 2.6.18-53.1.14.el5 #1 SMP Wed Mar 5 11:37:38 EST 2008 x86_64)
but it is not working in a windows server ( Windows NT P3SWH132 5.2 build 3790 ).
why?
Is there any differece in uploading files in windows server
or
is it the directory stucture given above ( '/ 'or '\\')
also the linux server is having php5.2.6
and the windows server is having php4.3.11 is anything to with this?
Help me. please find the error!