You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int ChunkSize = 1024;
try
{
using (Stream input = ((HttpRequest)context.Request).Advanced.InputStream)
{
var parser = new HttpMultipartParser.MultipartFormDataParser(input);
var task= parser.GetParameterValue("Task");
var fullAnswer= parser.GetParameterValue("FullAnswer")
// Loop through all the files
foreach (HttpMultipartParser.FilePart file in parser.Files)
{
using (BinaryReader reader = new BinaryReader(file.Data, context.Request.ContentEncoding))
{
using (BinaryWriter output = new BinaryWriter(File.Open(file.FileName, FileMode.Create)))
{
byte[] chunk = reader.ReadBytes(ChunkSize);
while (chunk.Length > 0)
{
output.Write(chunk);
chunk = reader.ReadBytes(ChunkSize);
}
}
}
}
}
}
catch (Exception e)
{
}
Have any example to work multipart/form-data from request?
POST request
The text was updated successfully, but these errors were encountered: