multipartform-data

Jaxrs multipart

老子叫甜甜 提交于 2019-12-04 01:59:04
I'm trying to perform a request to a jaxrs service which has media type set to multipart/form-data . This request contains a list of entities(xml) and an image(png, binary). I have created the request as described in this thread by BalusC. The request seems ok after inspecting it in wireshark, except for the ip header checksum being wrong.(says something about "may be caused by IP checksum offload".) My big issue here is how to handle the multipart request on the service side. I do not wish to include any libraries from apache.cxf, resteasy or anything of the sort. All I want to rely on is the

Facebook graph api: upload multipart/form-data encoded image

依然范特西╮ 提交于 2019-12-04 01:56:36
问题 I am trying to post an image using the source parameter (Multipart/form-data) in the Graph API explorer. My source parameter looks like this: {Content-Type: multipart/form-data; boundary=xxxsrixxx --xxxsrixxx Content-Disposition: attachment; filename=try2.gif Content-Type: image/gif Content-Transfer-Encoding: binary,base64

Spring boot multipart/related mime type support

烂漫一生 提交于 2019-12-04 01:46:56
问题 I need to consume a request whose content-type is multipart/related. Request will consist of image, json payload and binary content. I tried to find some example on how to handle such request in a Spring boot application, I found some references on how to handle multipart/form-data request but nothing related to multipart/related mime type. Request is something like this: POST /upload Content-Type: multipart/related; boundary="123asdf234" --123asdf234 Content-Type: application/json; charset

Image Upload in Vapor 3 using PostgreSQL

我只是一个虾纸丫 提交于 2019-12-04 01:22:26
I'm following this guys Martin Lasek Tutorials and now i'm at "image upload". It seems that no one has the answer to the question "How do you upload images i Vapor 3" Db connection is ok, all the other values are saved. This is mye create method: func create(_ req: Request) throws -> Future<Response> { return try req.content.decode(Question.self).flatMap { question in return question.save(on: req).map { _ in return req.redirect(to: "/form") } } } and Model: final class Question: PostgreSQLModel { var id: Int? var questionText: String var answers: [String] var theme: String? var imageName:

How can I See the content of a MultipartForm request?

和自甴很熟 提交于 2019-12-04 01:09:22
I am using Apache HTTPClient 4. I am doing very normal multipart stuff like this: val entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); entity.addPart("filename", new FileBody(new File(fileName), "application/zip").asInstanceOf[ContentBody]) entity.addPart("shared", new StringBody(sharedValue, "text/plain", Charset.forName("UTF-8"))); val post = new HttpPost(uploadUrl); post.setEntity(entity); I want to see the contents of the entity (or post, whatever) before I send it. However, that specific method is not implemented: entity.getContent() // not defined for MultipartEntity

unable to upload file using NSURLSession multi-part form data in iOS

被刻印的时光 ゝ 提交于 2019-12-04 00:04:11
I am trying to upload a video / image file using - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request fromFile:(NSURL *)fileURL; method using multi-part form data. But somehow i am not able to upload the file and i am getting " stream ended unexpectedly " error. Requirements Upload a video / image file to server App should support background uploads (Continue the upload process even after app goes into background) Server expects the data to be sent using multi-part form data. Methods / API's used to achieve this NSURLSession background session API (Complete code listed

Selecting multiple files and uploading them using Jersey

故事扮演 提交于 2019-12-03 21:35:56
I need help with multiple file uploads using Jersey. I used the following code to upload a single file using Jersey. package my.first.rest; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import javax.ws.rs.Consumes; import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.core.MediaType; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; @Path("uploadfile") public class Upload { String location; @POST

How to create an AWS Lambda/API gateway python function that takes a pdf file as input using multipart/form-data?

我只是一个虾纸丫 提交于 2019-12-03 21:10:39
I have been struggling with this for a while now. I need to create a resource in API gateway linking to a lambda function that takes a pdf file as input sent as a multipart/form-data POST request. To make it simple, I am just returning the file for now. When I try to call the API with the following curl, I get Internal server error from AWS. Did anyone ever succeeded to send a pdf file to Lambda without having to use the S3 trick (upload to S3)? Thank you all in advance for any hint. Commands/Files: curl curl -vvv -X POST -H "Content-Type: multipart/form-data" -F "content=@file.pdf" https://..

Play Framework Testing using MultipartFormData in a FakeRequest

老子叫甜甜 提交于 2019-12-03 17:39:25
问题 I am currently in the process of writing some Specs2 tests for may Play Framework 2.2.x application which accepts MultipartFormData submissions as part of it's function. I have successfully written other tests with text and JSON bodies using the following form: "respond to POST JSON with description field present" in { running(FakeApplication()) { val response = route(FakeRequest(POST, "/submission.json").withJsonBody(toJson(Map("content" -> toJson("test-content"), "description" -> toJson(

cURL with Alamofire - Swift - multipart/form-data

感情迁移 提交于 2019-12-03 17:25:57
First, im sorry if this question is stupid but im pretty new to this stuff. I've tried different things to create the swift equivalent of this cURL request with Alamofire, but I don't know how to send the image as a multipart/form-data to the API. curl -X POST -F "file=@/Users/nicolas/sample.png" -F "mode=document_photo" https://api.idolondemand.com/1/api/sync/ocrdocument/v1 -F "apikey=xxx-xxx-xxx-xxx-xxx" I think current code is pretty wrong for this type of request, but still i'm gonna post it for you: func getOCR(image: UIImage) { let url = "https://api.idolondemand.com/1/api/sync