Does anyone know how to use php to import a complete file and save it to the server that it is running on?
you mean upload file to server? if yes go to this page http://php.net/manual/en/features.file-upload.post-method.php
What I am actually wanting to do is import zip files with php from a different server. More like a transload.
I do not need to download. I need to copy from one server to another. I have tried a small script that uses the copy command but it will not get the file that I want. I am trying to import the clickbank xml zip file and just cannot figure out how to do it.
I was beginning to think this was not possible. Thanks. Can you explain how it works? I am supposing that 8192 is the port?
<?php $remoteFile = "http://www.domain.com/something.zip"; $localFile = basename($remoteFile); if ( false === file_put_contents($localFile, file_get_contents($remoteFile)) ){ throw new RuntimeException("Could not save file"); } ?> PHP:
I will try Chemo's version tomorrow. I think I can still use the other one as well. Is there anyway you can set the file size as a variable and let php fill it in?