multipartform-data

multipart/mixed response using NodeJS

浪尽此生 提交于 2019-12-13 04:38:50
问题 I've the following scenario: to return a multipart/mixed response that will contain the following items using NodeJS, where we control both ends of the communication so we should be able to eliminate interoperability issues. JSON file containing a list of nodes describing each ZIP i.e. [{name: test1, desc: Test1 Desc, md5: 1234ABCD, file: zip-01.zip}, {name: test1, desc: Test1 Desc, md5: 1234ABCD, file: zip-02.zip}] ZIP files are read from a mongo gridfs store --whoop Content-Disposition:

Why does file upload stop after sending a couple of chunks of data (using multipart/form-data)?

一世执手 提交于 2019-12-13 03:49:33
问题 I'm using libcurl to upload a firmware file to a hardware device. I'm using multipart/form-data and it looks like the file upload starts okay but it doesn't load the entire file. The file I'm uploading is 144,855,725 bytes but it appears that only two 64k chunks are being sent. In the posted code I am using a read callback function. I had also tried just passing the file name to the curl_mime_filedata function and the results were the same. One interesting note is that when I run the program

Image Upload using MVC API POST Multipart form

落爺英雄遲暮 提交于 2019-12-13 02:00:51
问题 My View :- <form class="commentform commentright" enctype="multipart/form-data" > <textarea class="simpleta required" name="Body" placeholder="Discuss this vehicle with other members of Row52."></textarea> <input type="file" id="fileuploadfield" name="fileuploadfield"/> <input type="submit" value="Submit" class="btn btn-inverse btn-small"/> <input type="hidden" name="ParentId" value="0"/> <input type="hidden" name="VehicleId" value="@Model.VehicleId"/> <span class="commentcount"><span class=

FormData doesn't work on upload files in React project with Redux and AXIOS when Its deployed

五迷三道 提交于 2019-12-13 00:25:58
问题 I have a full MERN stack project with Redux and AXIOS. I used FormData to upload the images to my node server which has the multer and it works perfectly fine on my localhost even tho console on my chrome said empty? (FormData {}). When it's deployed , my FormData is empty. So I tested my FormData without the files(just the input value from forms) and it passes to the server and has it on req.body. I tried to add config my formData and didn't work. What am i doing wrong??? For Example config:

AngularJS - ajax - MVC file multiple upload without form data

落爺英雄遲暮 提交于 2019-12-12 18:37:57
问题 I am using Flow.JS http://flowjs.github.io/ng-flow/ for file upload. My requirement is such that I will have to send the following data all in one save button click multiple files two string values alongwith the files. The following way works fine. Upload ajax call $scope.UploadFiles = function (flows) { var data = new FormData(); $.each(flows.files, function (i, flowfile) { data.append('file' + i, flowfile.file); }); data.append('message', $scope.Subject); data.append('subject', $scope

Trusting “Content-Type” on File Uploads

别等时光非礼了梦想. 提交于 2019-12-12 16:18:28
问题 If I'm supporting the upload of content (mostly images and video) by my REST API's users, is it safe to trust the Content-Type they declare in (multipart) uploads? Or should I, instead, run some kind of "media type detection" on the content (using, for example, Apache Tika) to ensure that the declared media type corresponds to the detected, actual one? Am I being over-zealous by introducing this media type detection step? 回答1: You certainly shouldn't blindly trust the Content-type header, or

How to pass parameter in multipart post request

…衆ロ難τιáo~ 提交于 2019-12-12 11:08:44
问题 Servlet code request.getparameter("fname") //I can't able to get value. HTML code <html> <head> <title>File Uploading Form</title> </head> <body> <h3>File Upload:</h3> Select a file to upload: <br /> <form action="UploadServlet" method="post" enctype="multipart/form-data"> <input type="text" name="fname" size="50" /> <input type="file" name="file" size="50" /> <input type="submit" value="Upload File" /> </form> </body> </html> My question is : How to pass fname parameter in multipart post

HttpClient StreamContent append filename twice

≡放荡痞女 提交于 2019-12-12 11:04:48
问题 I am using Microsoft Http Client Libraries to make a multipart request from Windows Phone 8 to the server. It contains a String content having json string and a Stream Content having image stream. Now i get the status OK and request hits on the server. but the logs says the server is not able to get the file name of the image. content.Add(new StreamContent(photoStream), "files", fileName); where the photoStream is the image stream, "files" is the name of content and file name is the name of

WebLogic 10gR3 - UnsupportedEncodingException parsing Content-Type header for multipart/form-data

好久不见. 提交于 2019-12-12 11:03:10
问题 My application is receiving multi-part content through an HTTP POST, on WebLogic 10gR3. Whenever clients specify the charset attribute before other attributes on the Content-Type header (e.g. Content-Type: multipart/form-data; charset=utf-8; boundary=a_random_boundary ), WebLogic is throwing the following exception (caught in my managed server's log): Unsupported encoding: "utf-8; boundary=a_random_boundary" specified. java.io.UnsupportedEncodingException: Unsupported Encoding utf-8; boundary

Trouble with Powershell script to call HTTP POST with multipart/form-data

戏子无情 提交于 2019-12-12 06:46:58
问题 I am developing a powershell script that should invoke a REST API using the HTTP POST method. The REST API is used to restore an application specific backup resource from external backup file. the KeyName for backup file in the form data must be "backupFile". The content type is multipart/form-data. Here is what i am doing: function invoke-rest { param([string]$uri) [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} #$enc = [system.Text.Encoding]::UTF8 $request =