我刚刚在Microsoft Azure下创建了一个网站("基本"计划).为了部署我的网站,我创建了一个可以上传我的网站代码的ftp用户.
除了这个上传FTP用户,我想创建另一个 FTP帐户,该帐户将拥有文件系统中特定目录的权限.
我在整个仪表板上搜索,并没有找到这个"创建ftp帐户"的线索.
我应该怎么做?
谢谢.
我需要通过PHP下载文件ftp_get(),但是愚蠢的提供程序正在使用包含空格的目录和文件名。.我正在处理的文件路径类似于/product info/more stuff/inventory and stuff.csv
路径和文件名本身中的空格使检索任何内容变得困难。我已经尝试了以下方法,但没有成功:
$path = "/product\ info/more\ stuff/inventory\ and\ stuff.csv";
$path = "/product%20info/more%20stuff/inventory%20and%20stuff.csv";
$path = '"/product info/more stuff/inventory and stuff.csv"';
再次感谢您抽出宝贵时间来帮助我。
我似乎无法弄清楚我做错了什么,我有以下代码将文件上传到ftp,它在一个新线程上,我怎么能告诉它等待上传完成再继续?
procedure TFTPThread.Execute;
begin
FTPClient.Host:=FTPAddress;
FTPClient.Username:=FTPUsername;
FTPClient.Password:=FTPPassword;
FTPClient.Connect;
FTPClient.Put(ZipFileName,'Logs.zip');
FTPClient.Quit;
FTPClient.Disconnect;
end;
Run Code Online (Sandbox Code Playgroud)
我在网上发现了这个,但我不确定我做错了什么:
E2233此处无法访问"手柄"属性
while WaitForSingleObject(TFTPThread.Handle, 0) = WAIT_TIMEOUT do
Application.ProcessMessages;
Run Code Online (Sandbox Code Playgroud) 我正在使用Apache Commons FTPClient,所以分别是logout和disconnect方法。我知道logout在要以其他用户身份通过同一连接重新登录时,这很有用;这里不是这样。
该ftp4j文档提到某些服务器根本不实现注销,因此我猜想这里是多余的,但是我想知道“粗鲁”的断开连接是否可能在服务器上留下悬挂的会话。
我有Windows服务,定期上传FTP服务器上的文件上传文件.我已经设定,
ServicePointManager.DefaultConnectionLimit = 100;
Run Code Online (Sandbox Code Playgroud)
我有,
public void MyMethod(string url,
string userName,
string password)
{
try
{
var request = (FtpWebRequest) WebRequest.Create(url);
request.Timeout = GetFtpTimeoutInMinutes()*60*1000;
request.Credentials = new NetworkCredential(userName, password);
request.Method = method;
request.UseBinary = true;
request.UsePassive = true;
request.KeepAlive = false;
request.GetResponse();
}
catch (Exception ex)
{
_logger.Log(ex);
}
Run Code Online (Sandbox Code Playgroud)
它的工作可以满足100或更多的要求但是在100或者更多之后我不断得到,
System.Net.WebException: The operation has timed out.
at System.Net.FtpWebRequest.CheckError()
at System.Net.FtpWebRequest.GetResponse()
Run Code Online (Sandbox Code Playgroud)
为什么会这样.
更新:我想进入http
我试图在线添加一行文本到txt文件,但我尝试的代码是替换文件中的所有txt而不是添加新行,即使在添加之后Enviorment.Newline.
这是我尝试过的:
private void submithsbtn_Click(object sender, EventArgs e)
{
WebClient client = new WebClient();
client.Credentials = new NetworkCredential("username", "password");
string peak = peakvaluelbl.Text;
string dir = @"ftp://example.com/file.txt";
string name = nametbox.Text;
client.UploadString(dir, name + " recived a peak score of: " + peak + Environment.NewLine);
}
Run Code Online (Sandbox Code Playgroud)
有谁知道我怎么能够达到这个结果?
我正在尝试使用套接字将文件上传到我的ftp服务器.它连接到服务器并可以读取目录但不上载文件."STOR"命令在服务器中创建一个空内容的文件.为什么我从服务器获取"无数据连接"响应并且我的文件为空?
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <arpa/inet.h>
int main(int argc, char *argv[])
{
argv[0]="2";
argv[1]="ip";
int sockfd = 0, n = 0;
char recvBuff[1024];
struct sockaddr_in serv_addr;
char mesUser[100]="USER ftpuser\n";
char mesPass[100]="PASS pass\n";
char meStor[100]="STOR xx\n";
char mesPasv[100]="PASV\n";
char meAppe[100]="APPE xx\n";
argc=2;
if(argc != 2)
{
printf("\n Usage: %s <ip of server> \n",argv[0]);
return 1;
}
memset(recvBuff, '0',sizeof(recvBuff));
if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
{ …Run Code Online (Sandbox Code Playgroud) 我正在尝试访问我在ftps服务器中创建的路径中的文件夹,但它没有返回任何内容,它正在连接但不返回任何内容,如果我将服务器配置更改为ftp就可以了.我正在使用FileZilla Server,其配置在上面.
SSL/TLS
标记为true在SSL/TLS设置上启用FTP over SSL/TLS支持(FTPS)和允许显式FTP over TLS
我的用户配置是:
在FireZilla Server的用户配置常规中,平面"强制SSL用于用户登录".
关于连接的服务器日志正在收到消息,我不知道它是否有帮助:
227进入被动模式
LIST
需要521 PROT P.
PASV
227进入被动模式
NLST
需要521 PROT P.
放弃
我的连接示例类是上面的每个权限:
公共类FTPClientExample2 {
public static void main(String[] args)
{
String server = "myip";
int port = 2121;
String user = "joao";
String pass = "1234";
boolean error = false;
FTPSClient ftp = null;
try
{
ftp = new FTPSClient("SSL");
ftp.setAuthValue("SSL");
ftp.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));
int reply;
ftp.connect(server, port);
System.out.println("Connected to ftp.wpmikz.com.cn");
System.out.print(ftp.getReplyString());
// After connection attempt, you …Run Code Online (Sandbox Code Playgroud) 我试图通过FTP在我的共享主机上运行我的Laravel 5项目.
我已将所有项目文件从本地XAMP文件夹上传到服务器根目录,并将文件放在public_html文件夹中的"public"文件夹中.
当我去mydomain.com时,我被重定向到mydomain.com/auth/login,因为我在routes.php中设置,所以虽然我在所有路径上都收到500内部服务器错误,但似乎工作正常.
我有一个批处理文件,我希望能够从命令行调用,如:
myBatch.bat testParam
Run Code Online (Sandbox Code Playgroud)
该批处理文件如下:
set sid=%1
C:\Windows\System32\ftp.exe -s:%0
goto done
open servername
username
password
get 'FilePath%sid%restoffilepath' targetPath\%sid%MyName.txt
bye
:done
Run Code Online (Sandbox Code Playgroud)
但是,我似乎无法使该FilePath%sid%restoffilepath部分正常工作 - 我相信这是因为它将%0输入视为字面意思,但我不是百分之百确定.%sid%变量未展开.
我基本上是想有FilePath%sid%restoffilepath是FilePathtestParamrestoffilepath在这种情况下.
ftp ×10
c# ×2
java ×2
append ×1
azure ×1
batch-file ×1
c ×1
cmd ×1
csv ×1
delphi ×1
delphi-xe ×1
deployment ×1
filesystems ×1
ftp-server ×1
ftps ×1
laravel-5 ×1
networking ×1
php ×1
sockets ×1
text ×1
windows ×1