![]() On the remote server, I have simple error checking. $data = array ('pic' => 'leaningtower', 'folder' => 'Pisa') Ĭurl_setopt($ch, CURLOPT_POSTFIELDS, $data) Ĭurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE) In this simple test routine, I want to copy the leaning tower photo to the correct folder, Pisa: $ch = curl_init() Here's another workaround using PHP cUrl to execute a copy request on the server by feeding parameters from the local machine and reporting the outcome: ![]() In case you actually want to move, then that's a completely different question. Side note: people often confuse move with copy. Though many FTP servers will reject this, as they wont allow data connection to/from an address different to the client's. This solution is shown in the answer by This is basically use of FXP protocol, but for one server. It falls back to an automatic duplication via a local temporary copy, if the above extension is not available.Īnother workaround is to open a second connection to the FTP server and make the server upload the file to itself by piping a passive mode data connection to an active mode data connection.It supports the SITE CPFR/ CPTO FTP extension (supported for example by the ProFTPD mod_copy module).Either using the extensions or via a temporary local copy of the remote file.įor example WinSCP FTP client does support the duplication using both drag&drop and menu/keyboard command: Some FTP clients do support the remote file duplication. ![]() Some FTP servers support proprietary or non-standard extensions for this though. There's no standard way to duplicate a remote file over the FTP protocol.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |