multipartform-data

Multipart file maximum size exception - spring boot embbeded tomcat

喜夏-厌秋 提交于 2019-11-30 19:25:46
I have set max file size to multipart.maxFileSize: 1mb multipart.maxRequestSize: 1mb This is my controller : @RequestMapping(method=RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @ResponseStatus(HttpStatus.CREATED) @Secured(Privileges.CAN_USER_READ) public void create(@RequestParam("file")final MultipartFile file,Principal principal) throws IllegalStateException, IOException,MultipartException{ medicalHistoryService.create(new MedicalHistory(file)); } this is error message 2016-03-03 13:48:24.560 WARN 4992 --- [nio-8080-exec-1]

Consuming a multipart/form-data via RESTful CXF

拈花ヽ惹草 提交于 2019-11-30 19:16:24
I've been working in a webservice that consumes and produces JSON files using Apache CXF in conjuction with Jackson. However, one of the service's methods should be able to save an uploaded image from a mobile application that makes a multipart/form-data POST request to my webservice, and I don't know how to treat this kind of content-type within my context. We usually create "Request" and "Response" objects to consume and produce the JSON, however, I'm afraid this would not work for this case. This is the Request format: Content-type: multipart/form-data "Description": text/plain "Path": text

How to send files with superagent

你。 提交于 2019-11-30 18:11:00
问题 So about a month ago I asked a question regarding superagent and sending files, but got no response at all. I would still like to find out how to do this as I enjoy using superagent. I am able to send files using plain ajax: var fd = new FormData(); fd.append( 'file', this.refs.File.getDOMNode().files[0] ); $.ajax({ url: 'http://localhost:8080/files', data: fd, processData: false, contentType: false, type: 'POST', success: function(data){ console.log(data) } }); But when I try the same thing

Android with Retrofit2 OkHttp3 - Multipart POST Error

…衆ロ難τιáo~ 提交于 2019-11-30 17:59:16
问题 I am using Retrofit2 with OkHttp on Android for HTTP request. Here I am doing a POST request with document upload. I ran into error below: D/OkHttp: <-- 500 Server Error http://api.drivewealth.io/v1/documents (4289ms) D/OkHttp: Date: Tue, 11 Apr 2017 03:29:48 GMT D/OkHttp: Cache-Control: must-revalidate,no-cache,no-store D/OkHttp: Content-Type: text/html; charset=ISO-8859-1 D/OkHttp: Server: Jetty(9.2.17.v20160517) D/OkHttp: Content-Length: 9323 D/OkHttp: Connection: keep-alive D/OkHttp:

Trying to post multipart form data in python, won't post

 ̄綄美尐妖づ 提交于 2019-11-30 17:57:50
问题 I'm fairly new to python, so I apologize in advance if this is something simple I'm missing. I'm trying to post data to a multipart form in python. The script runs, but it won't post. I'm not sure what I'm doing wrong. import urllib, urllib2 from poster.encode import multipart_encode from poster.streaminghttp import register_openers def toqueXF(): register_openers() url = "http://localhost/trunk/admin/new.php" values = {'form':open('/test.pdf'), 'bandingxml':open('/banding.xml'), 'desc':

Changing filename in BlobBuilder to be passed as FormData on XHR

会有一股神秘感。 提交于 2019-11-30 16:03:24
问题 I'm currently trying to upload an ArrayBuffer to a server (which i can't change) that expects the file i'm uploading on a multipart/form-data format. The server extracts from the Content-Disposition part the filename that will be saved and under Content-type the MIME type which will be used when serving the file. Currently, i'm succesful on uploading the file with: var xhr = new XMLHttpRequest(); var fdata = new FormData(); var bb; if (WebKitBlobBuilder) { bb = new WebKitBlobBuilder(); } else

Python Requests Multipart HTTP POST

我的梦境 提交于 2019-11-30 14:53:53
I was wondering how do you translate something like this using Python Requests? In urllib2, you can manually manipulate the data that is being sent over the wire to the API service, but Requests claims multipart file uploads are easy. However, when trying to send over the same request using the Requests library, I believe that it is not specifying some key parameters in the content-type for each of the two parts correctly. Can someone please shed some light on this matter. Thank you in advance! def upload_creative(self, account_id, file_path): """""" boundary = '-----------------------------'

Uploading blobs as Multi-part upload causes net::ERR_FILE_NOT_FOUND on Chrome after 500mb

柔情痞子 提交于 2019-11-30 12:01:55
问题 I'm having a really weird issue only on Google Chrome and Chromium. The background is: I upload files to my server using the multi-part upload method, meaning that I break the files into chunks of 10mb and send each chunk to the server. This works flawlessly in all browsers with files of any size, the issue started when I needed to encrypt each chunk. For encryption I use CryptoJS and, before uploading the chunk, I encrypt it and get the resulting Blob to upload, this works fine on Chrome

How to Create a Multipart HTTP Response With ASP.NET Core

佐手、 提交于 2019-11-30 08:41:05
I would like to create an action method in my ASP.NET Core controller which returns a Multipart HTTP Response containing several files. I know that using a .zip file is the recommended approach for websites but I am considering using such a request for an API. The examples I have been able to find in the ASP.NET Core samples are to do with multipart HTTP requests when uploading files. In my case, I want to download files. UPDATE I've raised the following GitHub issue: #4933 I've written a more generic MultipartResult class which just inherits from ActionResult : Usage Example [Route("

Android eclipse error on File upload to server

让人想犯罪 __ 提交于 2019-11-30 07:47:10
In my android eclipse project, i want to upload image file with name and email fields to server. But i got the following error : my logcat is following : NoSuchFieldError - BasicHeaderValueFormatter.INSTANCE E/AndroidRuntime(25348): Caused by: java.lang.NoSuchFieldError: org.apache.http.message.BasicHeaderValueFormatter.INSTANCE my entire logcat : E/AndroidRuntime(25348): FATAL EXCEPTION: AsyncTask #1 E/AndroidRuntime(25348): Process: com.example.uploadfiles, PID: 25348 E/AndroidRuntime(25348): java.lang.RuntimeException: An error occured while executing doInBackground() E/AndroidRuntime(25348