I solved the problem today at 10:33 GMT+3.
It has nothing to do with neither php version nor directory structure/naming.
It is because of the way that HTML5 handles the POSTed data. Depending on this change in HTML5, the copy() function is handling the source file as : "The source file of the copy() function must be the temp_name not the full path."
$recName = $_FILES['file_name']['tmp_name']
This link may give a brief idea about new HTML5 and DOM specs. : http://www.mail-archive.com/whatwg@l.../msg14076.html
The following final code is tested on 2 different remote servers for IE and FireFox. No errors occured, all the files POSTed were saved into the related directories in both explorers.
PHP Code:
<?php
if (!isset($_REQUEST['PLogo'])) {$PLogo="";} else $PLogo = $_REQUEST['PLogo'] ;
if (!isset($_REQUEST['Pname'])) {$Pname="";} else $Pname = $_REQUEST['Pname'] ;
if (!isset($_REQUEST['action'])) {$action="";} else $action = $_REQUEST['action'] ;
?>
<form name="Fedit" method="post" enctype="multipart/form-data">
<table align="center" width="600" cellspacing="2" cellpadding="2" style="border:1px outset #ECECEC;">
<tr>
<td bordercolor="#ececec" class="urunkart">Logo : </td>
<td bordercolor="#ececec">
<input type="file" name="PLogo" size="70" style="font:7pt verdana;color:#003399" >
</td>
</tr>
<tr>
<td bordercolor="#ececec" class="urunkart">Name for Logo : </td>
<td bordercolor="#ececec"><input type="text" name="Pname" size="50" maxlength="255" style="font:7pt verdana;color:#003399"></td>
</tr>
<tr>
<td bordercolor="#ececec" align="center" colspan="2">
<input type="submit" name="action" value="Save" onmouseover="this.style.cursor='pointer';">
</td>
</tr>
</table>
</form>
<?
$action = strtolower(trim($action));
switch($action)
{
case"save" : action_update($PLogo,$Pname);
break;
}
function action_update($PLogo,$Pname)
{
$PLogo = $_FILES['PLogo']['tmp_name'] ;
if ($PLogo !=="" )
{
chdir("./logo");
if (copy($PLogo, $Pname)) { echo ("$PLogo saved"); } else { echo ("$PLogo is not saved"); }
chdir("..");
}
}
?>
I thank all of you for your valuable supports.
Nejat
Bookmarks