|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-11-03 17:08 UTC] sniper@php.net
[2000-11-27 09:57 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 15:00:02 2025 UTC |
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...