php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7546 ftp_put error on open any file
Submitted: 2000-10-31 10:36 UTC Modified: 2000-11-27 09:57 UTC
From: rogeriop at programador dot net Assigned:
Status: Closed Package: FTP related
PHP Version: 4.0.3pl1 OS: windows nt
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rogeriop at programador dot net
New email:
PHP Version: OS:

 

 [2000-10-31 10:36 UTC] rogeriop at programador dot 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...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-03 17:08 UTC] 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-11-27 09:57 UTC] sniper@php.net
No feedback. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC