Error: Maximum response size reached get method Json object along with file part (Spring boot rest api)

This is a Postman specific error and it is generated because there is a Max Response Size limit available in the settings. By default it is 50 MB. Which means, Postman will fail the request if the response size exceeds 50 MBs. Since, you are receiving JSON data along with file part or file base64 … Read more

How to set a value to a file input in HTML to a client side disk file system path?

You cannot set it to a client side disk file system path, due to security reasons. Imagine: <form name=”foo” method=”post” enctype=”multipart/form-data”> <input type=”file” value=”c:/passwords.txt”> </form> <script>document.foo.submit();</script> You don’t want the websites you visit to be able to do this, do you? =) You can only set it to a publicly accessible web resource as seen … Read more

Renaming uploaded files with Carrierwave

Well, another problem with your random filename generator is that it’s possible to have collisions isn’t it? You could possibly generate a filename that was already generated. One way to go about it would be to somehow generate a hash based on unique properties of the image, like file path. An example, from the carrierwave … Read more

SPRING REST: The request was rejected because no multipart boundary was found

The problem isn’t in your code – it’s in your request. You’re missing boundary in your multipart request. As it said in specification: The Content-Type field for multipart entities requires one parameter, “boundary”, which is used to specify the encapsulation boundary. The encapsulation boundary is defined as a line consisting entirely of two hyphen characters … Read more

Multipart File upload using Springfox and Swagger-ui

I think you are missing the consumes attribute of the @RequestMapping in your second snippet. See the following example @RequestMapping( path = “/upload”, method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public ResponseEntity<String> handleUpload( @RequestPart(“file”) MultipartFile file, @RequestParam(“someId”) Long someId, @RequestParam(“someOtherId”) Long someOtherId) { return new ResponseEntity<>(); }

FtpWebRequest returns error 550 File unavailable

This error can be caused because of several reasons like file is not present on server, security permissions on file etc. etc. First you need to find out the exact cause of error. This can be achieved by using following code- try { //Your code } catch(WebException e) { String status = ((FtpWebResponse)e.Response).StatusDescription; } Once … Read more