logo
Tags down

shadow

400 BAD Request error on HttpMethod.PUT - File upload second time


By : dmitri.karpovich
Date : October 18 2020, 08:10 PM
it should still fix some issue I have a PUT request method in the controller where I upload zip file and the method takes it as inputstream and processes the stream. It works well with file sizes of Kb. Now I uploaded a zip file of 10Mb size, and it works fine the first time. The second time, it doesn't upload and I get the BAD request error. When I restart the service, it works fine for the first time and the second time I receive the same BAD Request 400 error. Pease advise , To upload a file in spring boot i prefere this approache :
code :
@RequestMapping(value = "/upload", method = RequestMethod.PUT) // Or POST
@ResponseStatus(HttpStatus.OK)
public void upload(@RequestParam("file") MultipartFile file) {

    System.out.println(String.format("File name %s", file.getName()));
    System.out.println(String.format("File original name %s", file.getOriginalFilename()));
    System.out.println(String.format("File size %s", file.getSize()));

    //do whatever you want with the MultipartFile
    file.getInputStream();
}


Share : facebook icon twitter icon

Ajax request during a file upload takes a long time to complete


By : Rihab Essam
Date : March 29 2020, 07:55 AM
should help you out Do you have websphere configured to compile and cache the jsp page, or is it recompiling each time?
You may want to use AOP, either AspectJ or Spring, or a profiler, to see what is going on with the ajax call, so that you can monitor without changing any code in the jsp page.

Blueimp jQuery File Upload and HttpHandler: No File and always "OPTIONS" HttpMethod


By : Alka Kumari
Date : March 29 2020, 07:55 AM
help you fix your problem I'm struggeling getting the Blueimp jQuery File-Uploader working on MVC 3 with IIS 7.5 on Windows Server 2008 R2. I'm using an HttpHandler to handle the Upload, which get's called. But the HttpHandler never recieves a file nor the HttpMethod "POST" or "PUT", always "OPTIONS". Has anyone an idea what is gouing wrong here? , Okay adding some code did the trick:
Server-side:
code :
        HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "http://example.net");
        HttpContext.Current.Response.AddHeader("Access-Control-Allow-Credentials", "true");
$('#fileupload').fileupload(
{
    xhrFields: {
        withCredentials: true
    }
}

Why use HttpMethod.POST instead of HttpMethod.GET in Google App Engine?


By : Jukesie
Date : March 29 2020, 07:55 AM
To fix the issue you can do No. What that means is that this method (whatever it is) is used to retrieve data from the server in response to a request from the client. Normally, when a client is just asking for something, it should use an HTTP GET. HTTP POST requests are intended for sending data to the server.
However, in this case, the client wants to send a (potentially large) object (called conferenceQueryForm) to the server to describe what it wants. That may be too big or cumbersome to do using a GET request, so instead they've used POST.

how to post http request with file upload several times with different file each time Jmeter


By : vincent.C
Date : March 29 2020, 07:55 AM
it helps some times Just replace hard-coded File Path with a JMeter Variable like: ${filePath}

HttpMethod.POST and HttpMethod.GET methods are not working in Facebook SDK for Unity


By : subrahmanya bhat
Date : March 29 2020, 07:55 AM
help you fix your problem Rohit, is the score still not visible on your activity log (on your timeline, click Activity Log, then filter down to stories from your app)?
shadow
Privacy Policy - Terms - Contact Us © voile276.org