0

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.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by girishpadia
0

Hi,
use following function.

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

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

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.