我正在尝试使用SimpleFTP https://github.com/kohyama/SimpleFTP
上传文件我的filezilla服务器这是我的代码:
var ftp_client:SimpleFTP = new SimpleFTP("127.0.0.1", "USER", "user1");
var test22:String = "Hello World!";
public function main():void
{
trace("Attempting to upload a file on: 127.0.0.1 ...");
connect_test_upload();
}
private function connect_test_upload():void
{
ftp_client.SimpleFTP.putFile("127.0.0.1", "USER", "user1", "\hello.txt", test22, function(res:String):void{});
trace("Success!");
}
我就像OMG IT WORKED,但实际上文件是0字节。 (AKA一个derp文件) Filezilla服务器控制台中没有错误。 请帮忙! d:
答案 0 :(得分:0)
你应该考虑做你所链接的页面建议:
要检查您的会话是否成功,请检查是否
res.substr(0,3) == "226"
,否则SimpleFTP.get()
调用您的handler
res
来自FTP服务器的响应res.substr(0,3) == "226"
不等于预期。如果public static IEnumerable<CultureInfo> GetAvailableCultures() { List<CultureInfo> result = new List<CultureInfo>(); ResourceManager rm = new ResourceManager(typeof(Resources)); CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures); foreach (CultureInfo culture in cultures) { try { if (culture.Equals(CultureInfo.InvariantCulture)) continue; //do not use "==", won't work ResourceSet rs = rm.GetResourceSet(culture, true, false); if (rs != null) result.Add(culture); } catch (CultureNotFoundException) { //NOP } } return result; }
,内容应保存为您指定的文件。