1

I use Flurl.Http in UWP and I can make a request to upload my photo to the server:

IBuffer buffer = await Windows.Storage.FileIO.ReadBufferAsync(file);
            string res = "";
            try
            {
                res = await upload_url.PostMultipartAsync(mp => mp
                    .AddFile("file", buffer.AsStream(), "story.png", null, (int)buffer.Length)
                    ).ReceiveString();
            }

But when I try to upload a video file in the same request form:

                IBuffer buffer = await FileIO.ReadBufferAsync(file);
            string res = "";
            try
            {
                res = await upload_url.PostMultipartAsync(mp => mp
                    .AddFile("video_file", buffer.AsStream(), "story.mp4", null, (int)buffer.Length)                        
                    ).ReceiveString();
            }

I get an 413 Error.

All answers I've found are relate to WCF application.

How I can change limit of max request length?:(

8
  • 1
    Possible duplicate of (413) Request Entity Too Large | uploadReadAheadSize Commented Apr 23, 2018 at 10:31
  • The answers you've found are correct - this is a server-side issue. Is the server app yours? If not you might be out of luck unless the server developers are willing to change the max allowed size. Commented Apr 23, 2018 at 13:22
  • @ToddMenier No, the server isn't mine, I make an API call to some service and receive an URL where I can upload my files. The I make POST request with file's bytes. The server actually allow me upload to 10Mb. Commented Apr 23, 2018 at 14:20
  • @ToddMenier Or do I need to add to my Solution new WCF project, and send a request over it? Commented Apr 23, 2018 at 14:25
  • The server is rejecting the request, saying that it's too large. You can't program around that on the client side. If you think the size of your file is well within the range of what they say they accept, you should contact them and ask why they are rejecting it. Commented Apr 23, 2018 at 14:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.