Jump to content

download from url


cronThis

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/87101-download-from-url/
Share on other sites

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.

 

Link to comment
https://forums.phpfreaks.com/topic/87101-download-from-url/#findComment-445459
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.