Questions tagged [multipart]

Multipart is content type that allows multiple MIME types to be embedded in a single message.

Commons uses of multipart subtypes include:

References

1904 questions
16
votes
4 answers

read failed: EBADF (Bad file descriptor) while reading from InputStream Nougat

With the recent changes in android N, I had to upgrade my code to use FileProvider to fetch images/files using camera/file manager. The code is working fine in emulator(genymotion) but throwing IO exception in Moto G4 plus. if(Build.VERSION.SDK_INT…
Debanjan
  • 2,817
  • 2
  • 24
  • 43
16
votes
4 answers

Retrofit 2 Multipart POST request sends extra quotes to PHP

Using Retrofit 2.0.1, there is a call function in my API interface defined in Android App: @Multipart @POST("api.php") Call doAPI( @Part("lang") String lang, @Part("file\"; filename=\"image.jpg") RequestBody file ); I send the…
Raptor
  • 53,206
  • 45
  • 230
  • 366
16
votes
2 answers

reading body part of a mime multipart

ok so I use .getcontent and receive javax.mail.internet.MimeMultipart@fd13b5 etc. I know i need something like this in my code but i dont know what exactly is needed. if (p.isMimeType("text/plain")) { pr("This is plain text"); …
J0rd4n500
  • 223
  • 1
  • 5
  • 14
15
votes
1 answer

Multipart/mixed email attachments not showing up, but only in Windows 10 Mail

Having a weird problem with emails I am sending out via Python email / smtplib. I am attempting to compose an email with: Alternatives of plain-text and HTML message bodies An image embedded inline in the HTML body A separate non-inline…
Eli
  • 636
  • 2
  • 7
  • 17
15
votes
1 answer

How to create a nested multipart / MIME envelope for Email in Go?

I'm trying to figure out how to build multipart/mime envelopes for emails in Go. The following code generates correctly-nested bodies - but the boundaries are not inserted correctly. You can see a demo on…
Xeoncross
  • 55,620
  • 80
  • 262
  • 364
14
votes
1 answer

Help improve my file upload method (Pyramid framework)

Currently, I am using the following method for uploading files (via HTML form) in Pyramid. if request.params.get('form.submitted'): upload_directory = os.getcwd() + '/myapp/static/uploads/' my_file = request.POST.get('thumbnail') …
sidewinder
  • 3,013
  • 6
  • 24
  • 33
14
votes
2 answers

Android okHttp addFormDataPart dynamically for Multiple Image

I had given answer Uploading a large file in multipart using OkHttp but i am stuck with multiple image uploading. I want to upload dynamically 1 to 10 image at a time. RequestBody requestBody = new MultipartBuilder() …
Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
14
votes
1 answer

Uploading file on server using retrofit

In my project, I've got to send an image taken from android device to server site, where it should be stored on disk. Unfortunately, when I call the method on the device site I meet this error: DEBUG/Retrofit(4429): java.lang.RuntimeException: …
Tiny dragons tail
  • 141
  • 1
  • 1
  • 7
13
votes
2 answers

How to define multiple parameters for a POST request using Java 11 HTTP Client

I have a code that makes a POST request for a specific endpoint. This code is using Apache's HttpClient and I would like to start using the native HttpClient from Java (JDK11). But I didn't understand how to specify the parameters of my…
Renan Gomes
  • 771
  • 1
  • 15
  • 34
13
votes
8 answers

Uploading image to server in Multipart along with JSON data in Android

I am trying to upload an image to a server along with some JSON data that is collected from a form. The server has authentication. METHOD: post HEADERS: Authorization Basic d2Vic2VydmljZTpyM05hdTE3Rw== Content-Type …
ReachmeDroid
  • 959
  • 1
  • 14
  • 17
13
votes
2 answers

FileNotFoundException while uploading multi part file - Spring boot

I am trying to upload the file via Multi part upload of spring boot application. While uploading the file, jetty throws FileNotFound Exception. Following is the model structure: private String identifier; private MultipartFile file; Following is…
Darshan Mehta
  • 30,102
  • 11
  • 68
  • 102
13
votes
4 answers

Converting MultipartFile to java.io.File without copying to local machine

I have a Java Spring MVC web application. From client, through AngularJS, I am uploading a file and posting it to Controller as webservice. In my Controller, I am gettinfg it as MultipartFile and I can copy it to local machine. But I want to upload…
Coder
  • 6,948
  • 13
  • 56
  • 86
13
votes
1 answer

iOS 7 - NSURLSession Resumable Uploads

I'm currently in the process of designing a system for uploading multiple images to a server from an application. The files will be stored on the local device and the current idea is to split them into chunks and then upload them chunk-by-chunk to…
Ryan Burke
  • 942
  • 7
  • 13
13
votes
2 answers

How to send a “multipart/related” with requests in python?

I'm trying to send a multipart/related message using requests in Python. The script seems simple enough, except that requests only seems to allow multipart/form-data messages to be sent, though their documentation does not clearly state this one way…
Zach Melnick
  • 521
  • 1
  • 6
  • 15
12
votes
5 answers

Golang io.copy twice on the request body

I am building a blob storage system and i picked Go as the programming language. I create a stream to do a multipart file upload from client to the blob server. The stream works fine, but i want to make a sha1 hash from the request body. I need to…