PHP Upload

Reply

Join Date: Sep 2007
Posts: 23
Reputation: becraig is an unknown quantity at this point 
Solved Threads: 0
becraig becraig is offline Offline
Newbie Poster

PHP Upload

 
0
  #1
Sep 24th, 2009
I am trying to find a simple script to upload some php files to my webserver.

I do not have ftp access over than via a GUI for the provider which sucks, I have a script running on my local server to make some file changes, I then want to put those files onto my remote server so users can see the updated info.

Does anyone know of a way I can do this that wont involve scripting an fwrite with multiple lines as there will be several pages and several hundred lines to copy.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 2
Reputation: girishpadia is an unknown quantity at this point 
Solved Threads: 0
girishpadia girishpadia is offline Offline
Newbie Poster

Re: PHP Upload

 
0
  #2
Sep 24th, 2009
Hi,
use following function.

function UploadOne($fname)
{
if (is_uploaded_file($fname['tmp_name']))
{
$filname = $curtime."_".basename($fname['name']);
$uploadfile = $uploaddir . $curtime."_".basename($fname['name']);
$copyfile = $copyfile . $curtime."_".basename($fname['name']);
if (move_uploaded_file ($fname['tmp_name'], $uploadfile))
{
$res = "File has been successfully uploaded and stored.<br>";
}
else
$res = "Could not move ".$fname['tmp_name']." to ".$uploadfile."<br>";
}
else
$res = "File ".$fname['name']." failed to upload.";
return ($res);
}

Call this function and send a filename with path as parameter.

Originally Posted by becraig View Post
I am trying to find a simple script to upload some php files to my webserver.

I do not have ftp access over than via a GUI for the provider which sucks, I have a script running on my local server to make some file changes, I then want to put those files onto my remote server so users can see the updated info.

Does anyone know of a way I can do this that wont involve scripting an fwrite with multiple lines as there will be several pages and several hundred lines to copy.
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC