php 此脚本通过FTP读取指定的文件并通过HTTP输出。因此,您可以在此脚本的URL上指向WP ALL Import

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 此脚本通过FTP读取指定的文件并通过HTTP输出。因此,您可以在此脚本的URL上指向WP ALL Import相关的知识,希望对你有一定的参考价值。

<?php
// Note: Anyone could access your data if they guess this URL. You should remove this file from the server 
// after importing or name it to something "unguessable". For even better security use an .htaccess rule.
//
// If you're experiencing problems you can uncomment the following line so errors will be sent to the file.
// ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
//
// Enter the FTP (or HTTP) URL of your data file below.
$url = "ftp://username:password@hostname.com/full/path/to/file.csv";

// These headers aren't strictly needed but can be helpful
header('Content-Type: text/plain');
header('Content-Disposition: attachment; filename="ftp-proxy-data.txt"');
header('Pragma: no-cache');

// Fetch the file and echo it
readfile($url);

以上是关于php 此脚本通过FTP读取指定的文件并通过HTTP输出。因此,您可以在此脚本的URL上指向WP ALL Import的主要内容,如果未能解决你的问题,请参考以下文章

Python--通过索引excel表将文件进行文件夹分类的脚本+读取指定目录下所有文件名的脚本

Java Socket编程之TCP

LINUX:如何检测 ftp 文件上传完成

C#通过socket判断FTP服务器是否通畅并判断用户名密码是否正确

day18-socket 编程

编写脚本,如何实现自动ftp到相应的环境,并下载相应的文件(shell)