public ActionResult Create(AirmanCertificateCreationModel airmanCertificateModel) { Mapper.CreateMap <AirmanCertificateCreationModel, AirmanCertificate>(); var airmanCertificate = Mapper.Map <AirmanCertificateCreationModel, AirmanCertificate>(airmanCertificateModel); var uploadResult = _fileUploaderService.UploadFile(airmanCertificateModel.CertificateFile, Server.MapPath("~/uploads")); if (uploadResult.Contains("failed")) { throw new IOException(uploadResult); } _repository.Save(airmanCertificate); return(RedirectToAction("Index")); }
public void Write(System.IO.Stream stream) { var file = FileUploaderService.UploadFile(DriveId, ParentDriveId, stream, Filename, FullPath); FileId = file.FileId; }
public void Write(string localFilePath) { var file = FileUploaderService.UploadFile(DriveId, ParentDriveId, localFilePath, Filename, FullPath); FileId = file.FileId; }