Example #1
0
 public bool UploadPart(string transferToken, int chunkIndex, byte[] part)
 {
     try
     {
         if (table.ContainsKey(transferToken) == false)
         {
             return(false);
         }
         FileUploadJob job = table[transferToken];
         if (job.UploadPart(chunkIndex, part) == true)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
     finally
     {
         sanitizeTable();
     }
 }
Example #2
0
        public string StartUpload(int totalBytes, int chunkSize)
        {
            FileUploadJob job = new FileUploadJob(totalBytes, chunkSize);

            table[job.ID] = job;
            return(job.ID);
        }
Example #3
0
 public bool CancelUpload(string transferToken)
 {
     try
     {
         if (table.ContainsKey(transferToken) == false)
         {
             return(false);
         }
         FileUploadJob job = table[transferToken];
         job.Cancel();
         return(true);
     }
     catch
     {
         return(false);
     }
     finally
     {
         sanitizeTable();
     }
 }