Ineed a SSH format command line of php to upload files to WinSCP FTP, I need ur ideas or get rid of this probs [closed]
Here is my code , that i have done so far needed ur guidance urgently.....
I already have d ftp server space, al i need now is a good command line for uploading to that WinSCP ftp....
<html>
<body>
<?php
if(isset($_FILES["uploaded"]))
{
print_r($_FILES);
if(move_uploaded_file($_FILES["uploaded"]["tmp_name"],"/sigaindia.com/public_html/reymend/".$_FILES["uploaded"]["name"]))
echo "FILE UPLOADED!";
}
else
{
print "<form enctype='multipart/form-data' action='fup1.php开发者_如何转开发' method='POST'>";
print "File:<input name='uploaded' type='file'/><input type='submit' value='Upload'/>";
print "</form>";
}
?>
</body>
</html>
Kindly do d needful frnds..... expecting ur ideas badly.....
I'm a little confused, but what I think you're asking for is a shell script to run that transfers a previously uploaded file?
If so, something as simple as the Linux cp command will do, it allows you to copy files to another location.
eg make a copy.sh with these contents, (chmod +x to make it executable as well):
cp /path/to/filename.txt /path/to/new/newfile.txt
You can then run this command from the shell with ./copy.sh
or inside PHP with the exec() command or even regularly with a crontab.
If you need to do this in PHP, you can use the copy() function.
精彩评论