예제 #1
0
        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"));
        }
예제 #2
0
        public void Write(System.IO.Stream stream)
        {
            var file = FileUploaderService.UploadFile(DriveId, ParentDriveId, stream, Filename, FullPath);

            FileId = file.FileId;
        }
예제 #3
0
        public void Write(string localFilePath)
        {
            var file = FileUploaderService.UploadFile(DriveId, ParentDriveId, localFilePath, Filename, FullPath);

            FileId = file.FileId;
        }