[Previo por Fecha] [Siguiente por Fecha] [Previo por Hilo] [Siguiente por Hilo]
[Hilos de Discusión] [Fecha] [Tema] [Autor]alguien me puedes ayudar con este script es qye cuando sube el archivo lo sube con temp.txt alguien yo le puse ese nombre alguien me puede decir como hacerle para que sea el nombre origila ya que si le dejo asi userfile me manda cabeceras. gracias
--- Begin Message ---
- To: lwong en librosyarte com mx
- From: root <root en pinguino datasys com mx>
- Date: Sat, 19 May 2001 22:52:13 -0500
<html> <body> <?php echo "<form ENCTYPE=\"multipart/form-data\" action=$PHP_SELF method=post>"; echo "<input type = file name=userfile><br>"; echo "<input type = Submit value='OK' name='OK'>"; echo "</form>"; if($OK or $cambia){ /* preg_match_all ("/^.*?(\\w+\.+\w+)/", $userfile, $matches); for ($i=0; $i< count($matches[0]); $i++) { echo "Archivo: ".$matches[1][$i]."<br>"; $quees = $matches[1][$i]; } */ //Start Var //Iniciamos Varibales $ftpServer = "200.52.16.203"; $ftp_user = "usrmane"; $ftp_pass = "pass"; //Open Conn //Abrimos la conexion $ftpStream = ftp_connect($ftpServer); $ftp_conn = ftp_login($ftpStream,$ftp_user,$ftp_pass); $temp = "temp.txt"; if($OK){ $ftp_up= ftp_put($ftpStream, "$temp", "$userfile" ,FTP_BINARY); //Open Array of list directory // Creamos el arreglo de la lista del directorio $ftp_ls = Array(); $ftp_ls = ftp_nlist($ftpStream,"."); echo "<form action=$PHP_SELF?>"; foreach($ftp_ls as $see_ls){ echo "<input type = text name=to value=$see_ls>"; echo "<input type=hidden name =from value=$see_ls>"; echo "<input type=submit value=cambia name=cambia>"; echo $see_ls."<br>"; } echo "</form>"; } //Close conn //Cerramos la conexion //$adios = ftp_quit($ftpStream); if($cambia){ $ren = ftp_rename($ftpStream,$from,$to); $ftp_ls = Array(); $ftp_ls = ftp_nlist($ftpStream,"."); echo "<form action=$PHP_SELF?>"; foreach($ftp_ls as $see_ls){ echo "<input type = text name=to value=$see_ls>"; echo "<input type=hidden name =from value=$see_ls>"; echo "<input type=submit value=cambia name=cambia>"; echo $see_ls."<br>"; } echo "</form>"; $adios = ftp_quit($ftpStream); } } ?> </body> </html>
--- End Message ---