multipartform-data

Not Posting image file in android using multipart httppost method

房东的猫 提交于 2019-12-20 05:44:14
问题 This question is borrowed from the same question, beacuse i faced same problem.During image posting in server side, image details could not getting in server side. Like this: Failed to post image file information php server, userid ok but image file information could not post.In this case, Image save successfully on server, i could not get information on php sever of image. Here is the Code: public class UploadImageHttpPost { String testpath="/mnt/sdcard/14111.jpg"; String url = "http:/

“too many HTTP redirects” while using Alamofire Upload Multipart Form Data

狂风中的少年 提交于 2019-12-20 04:16:36
问题 I'm using Alamofire 3 and encountered this: [Result]: FAILURE: Error Domain=NSURLErrorDomain Code=-1007 "too many HTTP redirects" UserInfo={NSUnderlyingError=0x15eb422d0 {Error Domain=kCFErrorDomainCFNetwork Code=-1007 "(null)"}, NSErrorFailingURLStringKey=URL omitted, NSErrorFailingURLKey= URL omitted, NSLocalizedDescription= too many HTTP redirects} while calling this method: upload(.POST, kTaskSubmitImageUrl, multipartFormData: { multipartFormData in multipartFormData.appendBodyPart(data:

Convert cURL request to Python-Requests request

与世无争的帅哥 提交于 2019-12-20 01:55:08
问题 I want to convert this cURL request to a Python-Requests request since I am working on a Python wrapper for a REST service MS_WORD_DOCUMENT=... CONTENT_TYPE="application/msword" JSON_REQUEST="{\"documentType\" : \"$CONTENT_TYPE\"}" curl -X POST -F "meta=$JSON_REQUEST;type=application/json" -F "data=@$MS_WORD_DOCUMENT" $SERVICE_ENDPOINT How can I convert this to a Python3 Requests library request? So far I've got to data = {"metadata": {"documentType": "application/msword", "Content-Type":

Uploading files using multipart/form-data through REST API

落爺英雄遲暮 提交于 2019-12-19 11:57:54
问题 I'm trying to upload 4 files to be used as a request body in a REST API call through Robot Framework. I'm using the Requests library to achieve this. I think I'm facing a problem with setting the correct MIME type/boundary as this is the error that is thrown if I run the file using pybot: {u'errorMessage': u"Couldn't find MIME boundary: ------Bound0901"} Is this the correct way to set the MIME boundary? Can I set custom MIME boundaries, like I have in the code sample given below? Or am I

How to enable Spring Reactive Web MVC to handle Multipart-file?

独自空忆成欢 提交于 2019-12-19 10:16:10
问题 I'm trying to use the new reactive web-mvc implementation in a spring boot 2.0 application. I'm trying to define a method which consume multipart file but do not succeed at making it working :( - I always get a 415 error. On one hand I have a controller containing the following request mapping : @RequestMapping(method = RequestMethod.POST, path = "/myPath/{param}/{param2}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @ResponseBody public Mono<Void> postFile( @RequestBody MultipartFile

How do I remove http artifacts from a multipart form-data request?

笑着哭i 提交于 2019-12-19 09:27:03
问题 I have this method signature in a jersery servlet. The servlet is being reached and the form data is present in the uploadedInputStream object, but the stream does not have the http artifacts removed from it. See below. @POST @Produces("text/plain") @Consumes(MediaType.MULTIPART_FORM_DATA) public String uploadFileIE( @FormDataParam("qqfile") InputStream uploadedInputStream ){ } When saved to a file, the input stream has these artifacts surrounding the byte data: ----------------------------

Curl -F equivalent in C#

江枫思渺然 提交于 2019-12-19 08:13:46
问题 I am trying to use HTTPClient object in C# to send a post request to an API. This is the CURL command: curl -X POST https://zzz.zzz.zzz/yyy -F Key=abcd -F media=@"audio.aac" I wrote the following code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net.Http; using System.IO; using System.Net.Http.Headers; namespace Speech2Text { class Program { static void Main(string[] args) { curl().Wait(); } static async Task

Curl -F equivalent in C#

陌路散爱 提交于 2019-12-19 08:13:03
问题 I am trying to use HTTPClient object in C# to send a post request to an API. This is the CURL command: curl -X POST https://zzz.zzz.zzz/yyy -F Key=abcd -F media=@"audio.aac" I wrote the following code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net.Http; using System.IO; using System.Net.Http.Headers; namespace Speech2Text { class Program { static void Main(string[] args) { curl().Wait(); } static async Task

FormData how to get or set boundary in multipart/form-data - Angular

六月ゝ 毕业季﹏ 提交于 2019-12-19 07:09:20
问题 I have a mini app, where I have to post a form data to an endpoint from browser. This is my post: var formData = new FormData(); formData.append('blobImage', blob, 'imagem' + (new Date()).getTime()); return $http({ method: 'POST', url: api + '/url', data: formData, headers: {'Content-Type': 'multipart/form-data'} }) Boundaries seems to be added by formData to the parameter, however, I cannot get it to send in the header, how should I done? 回答1: Well, seems that the headers ContentType should

does maxPostSize apply to multipart/form-data file uploads

假装没事ソ 提交于 2019-12-19 06:04:10
问题 I have a webapp on a Tomcat server that allows files to be uploaded. There is a limit on the size of a file upload, and I'd like that limit to be enforced preemptively (ie, once you cross the limit, the file upload fails, rather than transferring the whole file, checking that it's too big and then sending an error). I tried to do this by add maxPostSize="1000" to the connector section in the relevant connector in server.xml, but I can still upload larger files. I've seen a post indicating