Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.