cronThis Posted January 21, 2008 Share Posted January 21, 2008 Can anyone help? I'm integrating an upload system into a website i'm building, but instead of uploading the file from the users hard drive, i'm trying to create a script that fetches the file from a url, but I keep running into roadblocks when trying to find a way to do this. Files will be saved directly to the server. Quote Link to comment https://forums.phpfreaks.com/topic/87101-download-from-url/ Share on other sites More sharing options...
rhodesa Posted January 21, 2008 Share Posted January 21, 2008 http://us3.php.net/copy <?php copy($_POST['url'],'uploads/'.basename($_POST['url'])); ?> Obviously, the above is just an example. Any files being copied to your server should be thoroughly checked before they are put there. Also, the above will overwrite the file if it already exists. Quote Link to comment https://forums.phpfreaks.com/topic/87101-download-from-url/#findComment-445459 Share on other sites More sharing options...
cronThis Posted January 21, 2008 Author Share Posted January 21, 2008 Thanks, I'm going to give that a try. Quote Link to comment https://forums.phpfreaks.com/topic/87101-download-from-url/#findComment-445467 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.