php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15629 ftp_get downloads files to remote folders and note local folders
Submitted: 2002-02-19 14:53 UTC Modified: 2002-02-20 08:29 UTC
From: tiagoalves16 at yahoo dot com Assigned:
Status: Not a bug Package: FTP related
PHP Version: 4.1.1 OS: Unix Like
Private report: No CVE-ID: None
 [2002-02-19 14:53 UTC] tiagoalves16 at yahoo dot com
All the ftp_functions seens to work nicelly at my unix like server, but when i am trying to download a file from a FTP server(my_ftp_server" to my hard disk, the ftp_get function returns true, but the file goes to the same folder where my PHP script is running (a diferent server) named something like "c:\\songs\\complete.wav" 

below is my script:



$ftpStream = ftp_connect("my_ftp_server");
$loginResult = ftp_login($ftpStream, "my_user_name", "my_pass");
if ($loginResult) {

   $dir = ftp_chdir($ftpStream, "music/song");
   $file = ftp_pasv($ftpStream,true)    ;
            //get the remote file and put it in the same directory as the php file
   $file = ftp_get($ftpStream, 'c:\\songs\\complete.wav', "complete.wav", FTP_BINARY);
   echo $file;
            }
ftp_quit($ftpStream);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-20 08:29 UTC] sander@php.net
The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit http://www.php.net/support.php


 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Dec 06 18:03:34 2021 UTC