예제 #1
0
 public void UploadFile(string filePath,string fileName,int studyId,int userId, int findingId)
 {
     AudioUpload upload = new AudioUpload();
     try
     {
         currentUploadData = new UploadData();
         Logging.Instance.WriteLine("Current Uplaod Initialized");
         currentUploadData.chunkSize = upload.GetChunkSize();
         currentUploadData.uploadedFileStream = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.Read);
         currentUploadData.studyId = studyId;
         currentUploadData.userId = userId;
         currentUploadData.findingId = findingId;
         Logging.Instance.WriteLine("currentUploadDate = " + currentUploadData.ToString());
         Logging.Instance.WriteLine("File Size: " + currentUploadData.uploadedFileStream.Length);
         UploadFile(true);
     }
     catch (TargetInvocationException tie)
     {
         throw new VoiceControlExcpetion(Constants.Messages.Error.ServerNotAvailable);
     }
     catch (System.Net.WebException we)
     {
         throw new VoiceControlExcpetion(Constants.Messages.Error.ServerNotAvailable);
     }
     finally
     {
         upload.Dispose();
     }
 }