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(); } }
public string StartUpload(int totalBytes, int chunkSize) { FileUploadJob job = new FileUploadJob(totalBytes, chunkSize); table[job.ID] = job; return(job.ID); }
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(); } }