我需要 php 的 SSH 格式命令行来将文件上传到 WinSCP FTP,我需要你的想法或摆脱这个问题
这是我的代码,到目前为止我已经完成,迫切需要您的指导......
我已经有了 d ftp 服务器空间,我现在需要的是一个很好的命令行来上传到 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>
请做 d需要的朋友......非常期待你的想法......
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.....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有点困惑,但我认为您要求的是一个运行的 shell 脚本来传输以前上传的文件?
如果是这样,像 Linux cp 命令这样简单的命令就可以了,它允许您复制文件到另一个位置。
例如,使用这些内容创建一个 copy.sh,(chmod +x 使其也可执行):
然后您可以使用
./copy.sh
从 shell 运行此命令,或者使用 exec 在 PHP 中运行此命令() 命令甚至定期使用 crontab。如果您需要在 PHP 中执行此操作,可以使用 copy() 函数。
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):
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.