multipartform-data

Spring Boot (1.2.5.RELEASE) Resttemplate Multipart File Upload UTF-8 Filename not possible

纵然是瞬间 提交于 2019-12-22 12:39:08
问题 I have a Spring Boot Rest Service which uploads a file via the RestTemplate exchange method. The upload is working as it should but there is a problem with utf-8 filenames which for example contain german umlauts like äöü. When uploading a file from a HTML5 App it is working without any problem so it is not a problem at the receiving service. Without setting any encoding for the MultipartCharset the umlauts are replaced by "?" (e.g. Überschrift.txt gets ?berschrift.txt), as US-ASCII is used

Post Method + WinHttpRequest + multipart/form-data

一曲冷凌霜 提交于 2019-12-22 09:57:17
问题 I'm stumped why this doesn't work can't seem to find any problems. Here is the code. Public Const MULTIPART_BOUNDARY = "speed" Function getBalance() As String Dim sEntityBody As String Dim postBody() As Byte Dim username As String Dim password As String username = CStr(frmMain.txtUser.text) password = CStr(frmMain.txtPass.text) sEntityBody = "--" & MULTIPART_BOUNDARY & vbCrLf sEntityBody = sEntityBody & "Content-Disposition: form-data; name=""function""" & vbCrLf & vbCrLf & "balance" & vbCrLf

Using jQuery ajax to upload file and form data with formData()

走远了吗. 提交于 2019-12-22 09:19:27
问题 I want upload a file with jquery ajax and php using forData() with this code: var data = new FormData(); data.append('image',document.getElementById('uFile').files[0]); data.append('tag','saveDocument'); data.append('data',$('#saveDocument').serializeArray()); $.ajax({ url: url, type: 'post', data: data, cache: false, contentType:false, dataType: 'json', processData: false, success: function (data) { setAlert("Documento guardado correctamente!",success); }, error: function() { setAlert("Ha

Alamofire upload huge file

我只是一个虾纸丫 提交于 2019-12-22 08:57:37
问题 I am using Alamofire to upload assets (image/video) as multipart form data. It works fine for file sizes below 300MB (app). When I try to upload a file greater than 300MB, app crashes. if let video = self.avPlayerItem?.asset as? AVURLAsset { if let assetData = NSData(contentsOfURL: video.URL) { multipartFormData.appendBodyPart(data: assetData, name: "file", fileName: "video", mimeType: "video/mp4") // Execution stops here } } I also get the below message from Xcode How would I support

Multipart body length limit 16384 exceeded

冷暖自知 提交于 2019-12-22 08:34:03
问题 I've been trying to get this to work, but to no avail. What I am trying to do, is to upload a set of FormData images and attachments using JQuery AJAX. I keep getting the error: "Multipart body length limit 16384 exceeded" I found another similar question here on SO: Multipart body length limit exceeded exception If anyone here can help me out or point me in a direction, that would be greatly appreciated. It's almost midnight on my side, and I'm about to give up :(. I am using ASP.NET Core 1

uploading a file to imgur via python

£可爱£侵袭症+ 提交于 2019-12-22 08:23:21
问题 I'm having trouble uploading an image to Imgur using the python requests module and the Imgur API. My code is the following: import base64 import json import requests from base64 import b64encode client_id = 'my-client-id' headers = {"Authorization": "Client-ID my-client-id"} api_key = 'my-api-key' url = "http://api.imgur.com/3/upload.json" j1 = requests.post( url, headers = headers, data = { 'key': api_key, 'image': b64encode(open('1.jpg', 'rb').read()), 'type': 'base64', 'name': '1.jpg',

uploading a file to imgur via python

不打扰是莪最后的温柔 提交于 2019-12-22 08:22:02
问题 I'm having trouble uploading an image to Imgur using the python requests module and the Imgur API. My code is the following: import base64 import json import requests from base64 import b64encode client_id = 'my-client-id' headers = {"Authorization": "Client-ID my-client-id"} api_key = 'my-api-key' url = "http://api.imgur.com/3/upload.json" j1 = requests.post( url, headers = headers, data = { 'key': api_key, 'image': b64encode(open('1.jpg', 'rb').read()), 'type': 'base64', 'name': '1.jpg',

Equivalent of “curl -F” parameter for System.Net.Http.MultipartFormDataContent?

百般思念 提交于 2019-12-22 07:56:08
问题 I am trying to use the sonicAPI file/upload API in C#. My attempt to translate the curl example to C# with HttpClient and MultipartFormDataContent returns the error 400 / Bad Request . Content of the response : <?xml version="1.0" encoding="UTF-8"?> <response> <status code="400" /> <errors> <error message="File upload failed: file is missing." parameter="file" error_code="10" /> </errors> </response> Example of the curl command-line shown in the documentation : curl https://api.sonicapi.com

PATCH/PUT not accepting multipart/form-data file uploads?

情到浓时终转凉″ 提交于 2019-12-22 05:37:05
问题 Any idea why PATCH and PUT wouldn't be accepting multipart/form-data file uploads? When I run var_dump($_FILES) it outputs array(0) { } . Any ideas why this is happening? If I POST the file, it works fine. Below is an example of the request I am running. Thanks in advance! PUT /test.php HTTP/1.1 Content-Type: multipart/form-data; boundary=__X_PAW_BOUNDARY__ Host: [redacted] Connection: close User-Agent: Paw/2.1.1 (Macintosh; OS X/10.10.2) GCDHTTPRequest Content-Length: 17961 --__X_PAW

How to arrange the order of data and file using requests to post multipart/form-data?

痞子三分冷 提交于 2019-12-21 21:42:21
问题 I want to arrange file in front of data. If I try the traditional way, the data appears in front of file. To be more specifically, I want myfile to appear before form_value . form_value={'exp':'python', 'ptext':'text', 'board':'Pictures'} myfile = {'up': ('aa.png', open('aa.png', 'rb'), 'image/png')} r = requests.post(url, files=myfile, data=form_value, cookies=cookie) result Content-Type: multipart/form-data; boundary=170e4a5db6d74d5fbb384dfd8f2d33ce --170e4a5db6d74d5fbb384dfd8f2d33ce