public void uploadFile(string saveName, string fname, string path, int continueTransport = 0) { cs.CWD(path); FileStream fs = new FileStream(fname, FileMode.Open, FileAccess.Read); if (continueTransport == 1) { long fileSize = cs.SIZE(path + saveName); fs.Position = fileSize; } Console.WriteLine(fs.Position); int port = cs.PASV(); DataSocket ds = new DataSocket(this.serverIp, port); if (continueTransport == 1) { cs.APPE(saveName); } else { cs.STOR(saveName); } ds.readFileStream(fs); //cs.DATA_END(); }
public void uploadFile(string saveName, string fname, string path) { cs.CWD(path); int port = cs.PASV(); DataSocket ds = new DataSocket(this.serverIp, port); cs.STOR(saveName); FileStream fs = new FileStream(fname, FileMode.Open, FileAccess.Read); ds.readFileStream(fs); //cs.DATA_END(); }