i want to upload a file to my server from a url
i searched and i found this code:
$url = 'http://www.site.com/file.zip';
$rfile = fopen($url, 'r');
$lfile = fopen(basename($url), 'w');
fwrite($lfile, fread($rfile, BUFSIZ), BUFSIZ);
my problem is that the url is from a file sharing site that have user and password for download
how can i put user and pass to downalod in this code?