public long StoreFtp(HttpProcessor p)
 {
     String fileName = p.httpHeaders["X-File-Name"].ToString();
     FTPConnection ftp = new FTPConnection("127.0.0.1", "c", "c");
     Int64 startOffset = Convert.ToInt64(p.httpHeaders["X-Start-Offset"]);
     Int64 contenSize = Convert.ToInt64(p.httpHeaders["X-File-Size"]);
     ftp.OpenUploadStream(fileName, startOffset>0);
     long total = 0;
     try
     {
         total = ftp.UploadStream(p.inputStream, contenSize);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error" + ex);
     }
     ftp.Disconnect();
     return total;
 }
 public long OffsetFtp(HttpProcessor p)
 {
     String fileName = p.httpHeaders["X-File-Name"].ToString();
     FTPConnection ftp = new FTPConnection("127.0.0.1", "c", "c");
     long size = ftp.GetFileSize(fileName);
     ftp.Disconnect();
     return size;
 }