PHP 4.0 Bug #7546 Updated: ftp_put error on open any file
| From: | sniper@php.net | Date: | Mon, 27 Nov 2000 14:57:41 +0000 |
| Subject: | PHP 4.0 Bug #7546 Updated: ftp_put error on open any file | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-39279@lists.php.net to get a copy of this message | ||
ID: 7546
Updated by: sniper
Reported By: rogeriop@programador.net
Status: Closed
Bug Type: FTP related
Assigned To:
Comments:
No feedback.
Previous Comments:
---------------------------------------------------------------------------
[2000-11-03 17:08:07] sniper@php.net
Please reduce your example code to the absolut minimum
which can be used to reproduce your problem. And what is the
whole error message you get?
--Jani
---------------------------------------------------------------------------
[2000-10-31 10:36:32] rogeriop@programador.net
Here's my problem,i select a file with de file htlm object, and then i add it to a listbox,when
i use the ftp_put in my code the error on open file will occurr.
<?php
if ($HTTP_COOKIE_VARS["CES"]!=""){
if(getenv("REQUEST_METHOD")!="POST"){ ?>
<script language="JavaScript">
function AdicionarArquivo(){
var opcao=new Option;
opcao.text=enviar.arquivo.value;
enviar.arqsped.add(opcao);
enviar.arquivos.value=enviar.arquivos.value + enviar.arquivo.value + ",";
}
</script>
<html>
<head>
<title>C & S - INFORMÁTICA - Enviar Pedidos</title>
<style>
<!--
big{COLOR:GREEN;}
th{BACKGROUND:BLUE;COLOR:WHITE;FONT-FAMILY:Arial;}
-->
</style>
</head>
<body background="/images/backmaster.gif">
<center><big><big>Enviar Pedidos</big></big></center>
<p align="center">
<form method="POST" action="/transferir/pedidos/enviarpedidos2.php"
name="enviar">
<p align="center">
<select size="5" name="arqsped" multiple>
</select></p>
<p align="center"><input type="file"
name="arquivo"></p>
<p align="center"><input type="button" value="Adicionar
Pedido à Lista" name="B2" onclick="AdicionarArquivo()"></p>
<p align="center"><input type="submit" value="Enviar
Pedidos" name="B1"></p>
<input type="hidden" value=" " name="arquivos">
</form>
<p align="center"><a
href="/Transferir/opcoes.asp">Retornar</a></p>
</head>
</html>
<?php
} else {?>
<html>
<head><title>Enviando Arquivos</title></head>
<body>
<?php
//Inicia conexao ftp
$conexao_ftp=ftp_connect("www.site.com.br",21);
ftp_login($conexao_ftp,"username","password");
ftp_chdir($conexao_ftp,"/root/subfolder/subfolder");
//Atribui a uma array as strings separadas por virgulas
$arqsped=explode(",",$arquivos);
$tam=count($arqsped);
echo "Aguarde...";
echo "Enviando Pedidos...";
//Envia os pedidos para o servidor
for ($i=1; $i<>$tam; $i++)
{list(,$arqped)=each($arqsped);
echo "<center>$arqped</center><br>";
ftp_put($conexao_ftp,basename($arqped),"$arqped",FTP_ASCII);}
echo "Todos os pedidos foram enviados com êxito!";
//Encerra a conexao
ftp_quit($conexao_ftp);
?>
</body>
</html>
<?php }
} else {
header("Location: http://www.site.com.br/Login/loginerror.htm");
}?>
Thanx for any help...
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7546