Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

105
Views
how to call blob object as file to the asp.net MVC Controller

I successfully downloaded the file with the help of filesaver.js.

var out = doc.getZip().generate({
type: "blob",
mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
}) //Output the document using Data-URI
console.log(out);
saveAs(out,"Details.docx");

In out console I am getting object which contain size, Type.

How to save this downloaded file to AWS s3 Bucket by using ASP.NET MVC

how to call the file object to the controller

public ContentResult UploadDocument()
    {
        string result = "";
        try
        {
            int fileCount = Request.Files.Count;
            HttpPostedFileBase PostedFile = Request.Files[0];
            string path = "Test" + "_" + PostedFile.FileName;

            using (IAmazonS3 s3client = new AmazonS3Client(_awsAccessKey, _awsSecretKey, RegionEndpoint.USEast1))
            {
                PutObjectRequest putObjectRequest = new PutObjectRequest
                {
                    BucketName = _bucketName,
                    CannedACL = S3CannedACL.PublicRead,
                    Key = string.Format("FolderName/" + path),
                    InputStream = PostedFile.InputStream
                };
                s3client.PutObject(putObjectRequest);
            }
            result = "Success";
        }
        catch(Exception ex)
        {
            result = ex.Message;

        }
        
        return Content(result);
    }

I am getting Request.Files.Count null in the controller

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!