Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8909821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:31:51+00:00 2026-06-15T03:31:51+00:00

Using the S3-MultiPartAPI i get an exception: {Your proposed upload is smaller than the

  • 0

Using the S3-MultiPartAPI i get an exception:

“{“Your proposed upload is smaller than the minimum allowed size”}”

I test this with 2 files 11MB and 7MB. With 1MB it works without problems.

FileStream fs = new FileStream(foo, FileAccess.ReadWrite);

fs.CopyTo(new S3Tools.S3CopyMemoryStream(“bar”, new byte[Buffersize + Buffersize/2], transferUtility));

And i set the configuration utilityConfig.MinSizeBeforePartUpload to 2.

public class S3CopyMemoryStream : MemoryStream
    {
        private string _key;
        private byte[] _buffer;
        private S3TransferUtility _transferUtility;
        public StartUploadS3CopyFileStreamEvent StartUploadS3FileStreamEvent { get; set; }

        public int WriteCount { get; private set; }
        public bool EndOfPart { get; private set; }
        public bool InitiatingPart { get; private set; }
        public string UploadPartId { get; set; }
        public List<PartETag> PartETagCollection { get; set; }

        public S3CopyMemoryStream WithS3CopyFileStreamEvent(StartUploadS3CopyFileStreamEvent doing)
        {
            S3CopyMemoryStream s3CopyStream = new S3CopyMemoryStream(this._key, this._buffer, this._transferUtility);

            s3CopyStream.StartUploadS3FileStreamEvent = new S3CopyMemoryStream.StartUploadS3CopyFileStreamEvent(CreateMultiPartS3Blob);

            return s3CopyStream;
        }

        public S3CopyMemoryStream(string key, byte[] buffer, S3TransferUtility transferUtility)
            : base(buffer)
        {
            InitiatingPart = true;
            EndOfPart = false;
            WriteCount = 1;
            PartETagCollection = new List<PartETag>();
            QueueWithIncompleteParts = new Queue<int>();

            _buffer = buffer;
            _key = key;
            _transferUtility = transferUtility;
        }

        public delegate void StartUploadS3CopyFileStreamEvent(S3TransferUtility transferUtility, string key, S3CopyMemoryStream stream);          

        public override bool CanSeek
        {
            get { return false; }
        }

        public override void Write(byte[] array, int offset, int count)
        {
            base.Write(array, offset, count);

            if(Position >= Buffersize)
            {
                if (WriteCount > 1)
                    InitiatingPart = false;
                StartUploadS3FileStreamEvent.Invoke(_transferUtility, _key, this);

                WriteCount++;
                base.Flush();
                base.Seek(0, SeekOrigin.Begin);
                base.Flush();

            }              
        }

        public override void Close()
        {
            if(WriteCount > 1)
                InitiatingPart = false;

            EndOfPart = true;
            StartUploadS3FileStreamEvent.Invoke(_transferUtility, _key, this);
            base.Close();
        }

    }

This is the Uploadevent. In this line i get the exception.

CompleteMultipartUploadResponse completeMultipartUploadResponse =
transferUtility.S3Client.CompleteMultipartUpload(completeMultipartUploadRequest);

 static internal void CreateMultiPartS3Blob(S3TransferUtility transferUtility, string key, S3CopyMemoryStream stream)
    {

        if (stream.InitiatingPart)
        {
            InitiateMultipartUploadRequest initiateMultipartUploadRequest =
                new InitiateMultipartUploadRequest()
                    .WithBucketName(transferUtility.BucketName)
                    .WithKey(key);


            InitiateMultipartUploadResponse initiateResponse =
                transferUtility.S3Client.InitiateMultipartUpload(initiateMultipartUploadRequest);
            stream.UploadPartId = initiateResponse.UploadId;

        }


            UploadPartRequest uploadPartRequest =
                new UploadPartRequest()
                    .WithBucketName(transferUtility.BucketName)
                    .WithKey(key)
                    .WithPartNumber(stream.WriteCount)
                    .WithPartSize(stream.Position)
                    .WithUploadId(stream.UploadPartId)
                    .WithInputStream(stream) as UploadPartRequest;

            UploadPartResponse response = transferUtility.S3Client.UploadPart(uploadPartRequest);
            PartETag etag = new PartETag(response.PartNumber, response.ETag);
            stream.PartETagCollection.Add(etag);



        if (stream.EndOfPart)
        {

            CompleteMultipartUploadRequest completeMultipartUploadRequest =
                new CompleteMultipartUploadRequest()
                    .WithBucketName(transferUtility.BucketName)
                    .WithKey(key)
                    .WithPartETags(stream.PartETagCollection)
                    .WithUploadId(stream.UploadPartId);

            CompleteMultipartUploadResponse completeMultipartUploadResponse =
                transferUtility.S3Client.CompleteMultipartUpload(completeMultipartUploadRequest);
            string loc = completeMultipartUploadResponse.Location;

        }

    }

Any suggestions what the problem is?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:31:53+00:00Added an answer on June 15, 2026 at 3:31 am

    The Request uses the stream from the current position so i have to set the position to zero before uploading.

    First think than post .. *g

    greetings

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using NSDateComponents I know how to get the day component, but this gives me
Using rubular.com as a guide, I am trying to get this expression to work
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using CI for the first time and i'm smashing my head with this seemingly
Using the Redis info command, I am able to get all the stats of
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
Using Core Data, I have a fetch request to fetch the minimum of a
Using C++ preprocessor directives, is it possible to test if a preprocessor symbol has
Using jQuery, how do I get the value from a textbox and then load

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.