Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file download/upload script

Status
Not open for further replies.
you will have to use a standard text field where the user can enter in the url to the file. You will then have to perform an fopen() or popen on that url, then read in the contents of that file and then save the contents to a file in your specified location (to save the file as the same name as the file you opened, you just have to grep through the url to find it.

Chad. ICQ: 54380631
online.dll
 
thanks, i'll see what i can do. i just found the manual pages for the error codes so i can figure it out now.
 
figured it out, here it is if anyone else needs it:

function copyFromRemote($remote,$local){
$fp1 = fopen($remote,"r");
$fp2 = fopen($local,"w");
//Print("Opened them");
while(!feof($fp1)) {
$line = fread($fp1,1024);
fputs($fp2,$line,strlen($line));
}
//Print("Got it");
}

copyFromRemote($userfile, $serverfile); //use it like this

for binary files or use

$line = fgets($fp1, 1024);

for other types
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top