コード例 #1
0
        public Response Conversion(string outputType)
        {
            Response response = null;
            var      files    = Request.Files;

            foreach (string fileName in Request.Files)
            {
                HttpPostedFileBase postedFile = Request.Files[fileName];

                if (postedFile != null)
                {
                    var isFileUploaded = FileManager.UploadFile(postedFile);

                    if ((isFileUploaded != null) && (isFileUploaded.FileName.Trim() != ""))
                    {
                        AsposePdfConversion asposePdfConversion = new AsposePdfConversion();
                        response = asposePdfConversion.Convert(isFileUploaded.FileName, outputType.ToLower().Replace(" ", ""));

                        if (response == null)
                        {
                            throw new Exception(Resources["ResponseTime"]);
                        }
                    }
                }
            }

            return(response);
        }
コード例 #2
0
        public Response Conversion(string outputType)
        {
            Response response = null;

            if (Request.Files.Count > 0)
            {
                string _sourceFolder = Guid.NewGuid().ToString();
                var    docs          = UploadDocuments(Request, _sourceFolder);

                AsposePdfConversion pdfConversion = new AsposePdfConversion();
                response = pdfConversion.ConvertFile(docs, outputType, _sourceFolder);
            }

            return(response);
        }