|
发表于 2024-7-31 10:24
来自手机
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
伶俐的毛豆 发表于 2024-7-31 09:34
可以展示一下代码吗
<?php
$local_path='/storage/emulated/**/htdocs/ceshi/viewdocx/file_tree_u2.php';
ftpUpload($local_path);
die;
function ftpUpload($local_path){
// Allows overwriting of existing files on the remote FTP server
$stream_options = array('ftp' => array('overwrite' => true));
// Creates a stream context resource with the defined options
$stream_context = stream_context_create($stream_options);
$ftp_path=str_replace('/storage/emulated/0/Download/htdocs','ftp://webmaste*j*r@用户名:密码@服务端地址/WEB',$local_path);
echo $ftp_path;
$contents=file_get_contents($local_path);
//echo $contents;
// Opens the file for writing and truncates it to zero length
if ($fh = fopen($ftp_path, 'w', 0, $stream_context))
{
// Writes contents to the file
//fputs($fh, 'example contentsaaaa');
fputs($fh, $contents);
// Closes the file handle
fclose($fh);
echo "\nok\n";
}
else
{
die('Could not open file.');
}
}
|
评分
-
1
查看全部评分
-
|