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
0
votes
0 answers

How to send JPEG image in multipart request using HttpURLConnection

I want to send image from gallery/camera to server. This image is compressed Bitmap and it is converted to ByteArray. Problem is that server returns error -> file is not JPEG. That means server did not recognized my content as JPEG. What could be…
martin1337
  • 2,384
  • 6
  • 38
  • 85
0
votes
1 answer

How to check whether files successfully uploaded

I'm setting up an application to accept a dynamic multipart files upload form. I add a conditional if rule for uploaded type and extension. For conditional fulfilled to be accepted and store in DB, and for the empty post file should be ignored, for…
0
votes
1 answer

java.lang.ArrayIndexOutOfBoundsException: size=2048 offset=0 byteCount=-1

Why I will get this exception in writeTo function? 2019-07-02 12:17:03.525 13663-14248/com.zoinla.pegasus_work E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher Process: com.xxx, PID: 13663 java.lang.ArrayIndexOutOfBoundsException:…
John Joe
  • 12,412
  • 16
  • 70
  • 135
0
votes
1 answer

how to upload a file to spring boot using angular 7?

In order to upload a file in angular 7 for a spring boot project, I am getting 404 with error blocked by CORS policy. the angular code::: uploadFile(file: File){ console.log("file to be uploaded...",file); const postData = new…
0
votes
2 answers

How to avoid redundant traffic in Spring Boot application?

I have Spring-Boot 2.x application, and some rest controller endpoint that uploads multipart file, like this @PostMapping("/somePath") public ResponseEntity someController(@RequestParam MultipartFile file) ) also we have jwtFilter in…
0
votes
1 answer

JQuery event handler is preventing my form from submitting

The following code is supposed to modify the aesthetic and function of a submit button: $('[data-image-upload-button]').click(function(){ if ($('[data-product-image-input]')[0].files.length > 0) { …
0
votes
2 answers

What's the simplest reliable way to encode multiple jpeg images in a single byte string?

I need to publish a Google Cloud Pub/Sub message with multiple jpeg images. It needs to go in the data body. Putting it as a base64-encoded string in an attribute won't work, because attribute values are limited to 1024…
jacob
  • 2,762
  • 1
  • 20
  • 49
0
votes
1 answer

Ruby Imap Multipart Fetch

I trying use the Ruby IMAP library ("net/imap") to get email. I get messages with html and text plain but I need the text plain only ... My Code Is ... imap = Net::IMAP.new('XXX') imap.authenticate('LOGIN', 'USER', "PASS") imap.examine('INBOX')…
0
votes
1 answer

Why isEmpty () not null checked?

First, ask for your understanding that English is not fluent. I am currently implementing an upload function using MultipartFile. It is checking for an empty value with isEmpty() in case there is no file. When i submit without selecting a file, a…
eastglow
  • 219
  • 3
  • 18
0
votes
0 answers

Spring Boot 2 MockMVC unit testing with RequestPart and MultipartFile

I have the below email controller for sending email with RequestPart DTO object (userDTO) and Multipart file (3 files upload max). where userDTO is a JSON object I tried using postman and it works perfectly for sending email with attachments,…
0
votes
0 answers

How to show the Network Response body in android using volley

How to show the Network response in android using volley getting response in postman like this how to show this response in android? I tried this way using JSONobject but nothing happens VolleyMultipartRequest volleyMultipartRequest = new…
Solanki Zeel
  • 548
  • 1
  • 7
  • 18
0
votes
2 answers

How to extract Java Email body without auto wrapping every line to 76 chars

I am trying to extract the body of the email using Java mail. When I try to extract the body of the email using the below code, the email wraps every line to 76 chars by appending new line char. I want the original email formatting with no wrapping…
0
votes
0 answers

MockMultipartFile not working in real environment, as it is available in test package of spring. Is there any workaround for this?

I have a file on my local disk, I want to convert that file to multipart file as I need to upload this file to another server. I am converting file to multipart file using MockMultipartFile, but it is not working as this package is only available in…
0
votes
0 answers

Can't convert Document to MockMultipartFile

I need to convert a Document to a MultipartFile, and I've found I can use MockMultipartFile. The problem is that I can't get the InputStream that I need for my MockMultipartFile. What I'm doing is this, that I've found in another question: Document…
Usr
  • 2,628
  • 10
  • 51
  • 91
0
votes
1 answer

unable to upload file of size more than 1 MB using multipart request, /upload_c8f18d91_ba00_4810_96de_422cdd2e9b75_00000016.tmp (Permission denied)

I am trying to write a file in a folder of a remote system using multipart request , While uploading size greater than 1 MB getting error: "stacktrace":["org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet…