414 Request-URL Too Large (Uploading with Vue JS)

Comments

4 comments

  • Avatar
    Michal Kuperman

    Hi Daniel,

    Looking at the logs it seems that the file wasn't included which resulted in this error: "Missing required parameter - file".

    Can you please verify that the file is included in the body of the POST request?

    Thanks,

    Michal

    0
    Comment actions Permalink
  • Avatar
    Daniel Egry

    yes it is included, and i could upload it with curl, I just can not seem to find any problems in my code... But there are always 2 options:

    - If i send it as a request parameter the URL is too large

    - If i send it in request body "I get Missing required parameter...File" error

    0
    Comment actions Permalink
  • Avatar
    Aleksandar Kostadinov

    Hi Daniel,

    Firstly, the request shouldn't be sent with query string parameters and the request method needs to be POST. These are the first things to ensure are always set correctly. If you are seeing an issue with this setup then this needs to be looked into.

    For example, I have created a working test JSFiddle for you that uses Axios and sends FormData to Cloudinary.
    https://jsfiddle.net/aleksandar_cloudinary/47Lghaoj/

    There are two parts to the JSFiddle. What I would recommend you do is to include that code (2 lines FormData and Axios call) in your project and also provide an unsigned upload preset value. The File parameter I have given is a Base64 Data URI to a valid 1x1 pixel image. The reason for this setup is to ensure you can successfully upload this file in your account using this approach within your project. Once you add your cloud_name, upload preset and run that part of your project you should see in the console a successful response and the 1x1px image in your account.

    Once that works for you, please remove this test code and add the code below it which are the same parameters from your example added in the same fashion as Form Data. You will need to wrap that code within your existing project inside your reader's on "load" event listener, but the core part would be the same. Then you should be able to test the upload again.

    May I please ask you to try this and let us know how it goes. If it doesn't work, please share an example public_id from the request so that we can use that to find the relevant logs on our side. We can then see what parameters were passed and why that may not have worked for you.

    0
    Comment actions Permalink
  • Avatar
    evanchitger

    Under Apache, the limit is a configurable value, LimitRequestLine. Change this value to something larger than its default of 8190 if you want to support a longer request URI. Extremely long URLs are usually a mistake. If you keep URLs under 2000 characters , they'll work in virtually any combination of client and server software. URI actually have a character limit depending on several things. Chrome limits url length of 2MB for practical reasons and to avoid causing denial-of-service problems in inter-process communication. On most platforms, Chrome's omnibox limits URL display to 32kB ( kMaxURLDisplayChars ) although a 1kB limit is used on VR platforms. IE - 2083 characters, Firefox - 2047 characters, Safari 80000 characters and Opera 190,000 characters.

    To resolve the problem :

    • By POST request: Convert query string to json object and sent to API request with POST
    • By GET request: Max length of request is depend on sever side as well as client side. Most webserver have limit 8k which is configurable. On the client side the different browser has different limit. The browser IE and Safari limit to 2k, Opera 4k and Firefox 8k. means the max length for the GET request is 8k and min request length is 2k.

    If exceed the request max length then the request truncated outside the limit by web server or browser without any warning. Some server truncated request data but the some server reject it because of data lose and they will return with response code 414.

     

    0
    Comment actions Permalink

Please sign in to leave a comment.