Problema com Codigo de FTP
Olá!
Estou com um problema no código para FTP.
O sistema estava funcionando, mas não sei o que aconteceu agpora, pois quando tento enviar um arquivo por ele da essa mensagem de erro:
Warning: move_uploaded_file(../../FTP/Clientes/index.html) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/jcndigital/public_html/index2.php on line 200
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpSYfH8n' to '../../FTP/Clientes/index.html' in /home/jcndigital/public_html/index2.php on line 200
Ocorreu um erro ao tentar enviar o arquivo, tente novamemente.
Essa é a linha do codigo, a linha 200 que esta dando erro:
if(move_uploaded_file($_FILES['upfile']['tmp_name'], $target_path)) {
<html xmlns="[http://www.w3.org/1999/xhtml"](http://www.w3.org/1999/xhtml) xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
</style>
<!--[if gte IE 6]>
<script src="dynActiveX.js"></script>
<![endif]-->
<link href="ftp/style/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
#Layer1 {
position:absolute;
left:644px;
top:185px;
width:223px;
height:137px;
z-index:1;
}
.style4 {
font-size: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style5 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 12px;
color: #CC3300;
}
.style3 {
color: #CCCCCC;
font-size: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
a:link {
color: #CCCCCC;
text-decoration: none;
}
a:visited {
color: #CCCCCC;
text-decoration: none;
}
a:hover {
color: #CCCCCC;
text-decoration: none;
}
a:active {
color: #CCCCCC;
text-decoration: none;
}
.style6 {font-size: 12px}
-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body bgcolor="#fefefe" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<div align="center">
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="63%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','750','height','165','src','site/menu','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','site/menu' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="[http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"](http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0) width="750" height="165">
<param name="movie" value="site/menu.swf">
<param name="quality" value="high">
<embed src="site/menu.swf" quality="high" pluginspage="[http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"](http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash) type="application/x-shockwave-flash" width="750" height="165"></embed>
</object></noscript></td>
</tr>
</table>
<table border="0" width="100%" cellspacing="5" cellpadding="5">
<tr>
<td width="69%" height="32" valign="top"><span style="font-size: 14pt; color: #CC3300"><b><span style="font-family: Verdana,sans-serif">FTP JCN Digital</span></b></span></td>
<td width="31%" valign="middle"><span class="style5">Instruções para enviar arquivos:</span></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="5" cellspacing="5">
<tr>
<td valign="top"><?php
//Windows way
$uploadLocation = "";
//Unix, Linux way
$uploadLocation = "../../FTP/Clientes/";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<div id="main">
<div id="caption">ENVIAR ARQUIVO<br>
<br>
<span class="style6">Esse procedimento pode demorar alguns minutos dependendo da sua conexão e do tamanho do arquivo.</span></div>
<div id="icon"> </div>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="fileForm" id="fileForm" enctype="multipart/form-data">
Selecione o Arquivo:
<center>
<table width="100">
<tr>
<td><input name="upfile" type="file" size="36"></td>
</tr>
<tr>
<td align="center"><br/>
<input class="text" type="submit" name="submitBtn" value="Enviar"></td>
</tr>
</table>
</center>
</form>
<?php
if (isset($_POST['submitBtn'])){
?>
<div id="caption">RESULTADO</div>
<div id="icon2"> </div>
<div id="result">
<table width="100%">
<?php
$target_path = $uploadLocation . basename( $_FILES['upfile']['name']);
if(move_uploaded_file($_FILES['upfile']['tmp_name'], $target_path)) {
echo "O Arquivo: ". basename( $_FILES['upfile']['name']).
" foi enviado com sucesso!";
} else{
echo "Ocorreu um erro ao tentar enviar o arquivo, tente novamemente";
}
?>
</table>
</div>
<?php
}
?>
</div></td>
<td valign="top"><p><span class="style4"><strong>1.</strong> Clique no botão Procurar... ; <br>
<strong>2.</strong> Na tela exibida, localize o arquivo, clique sobre ele e em seguida, na mesma tela, clique no botão Abrir;<br>
<strong>3.</strong> Clique no botão Enviar;</span><br>
<br>
<span class="style4">Se tudo ocorreu corretamente, a seguinte mensagem será exibida:<br>
"O Arquivo: (nomedo arquivo) foi enviado com sucesso!</span><br>
<br>
<span class="style4">Caso contrario, a seguinte mensagem será exibida: "Ocorreu um erro ao tentar enviar o arquivo, tente novamemente. " <br>
Caso essa mensagem apareça, refaça os passos 1, 2 e 3 descritos acima.</span><br>
</p>
<p> </p></td>
</tr>
<tr>
<td colspan="2" valign="top"><div align="left"></div></td>
</tr>
</table></td>
</tr>
</table>
</div>
</body>
</html>
Não tenho a minima ideia o q pode estar acontecendo.
Alguem poderia me ajudar?
Obrigado.
Discussão (1)
Carregando comentários...