Skip to content

Commit cc6d7e2

Browse files
committed
Use MemoryStream instead of Filestream for form data
1 parent f3addbc commit cc6d7e2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Connection/RESTConnector.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,10 @@ public Form(int n)
121121
/// <param name="contents">The binary data.</param>
122122
/// <param name="fileName">The filename of the binary data.</param>
123123
/// <param name="mimeType">The mime type of the data.</param>
124-
public Form(System.IO.FileStream contents, string fileName = null, string mimeType = null)
124+
public Form(System.IO.MemoryStream contents, string fileName = null, string mimeType = null)
125125
{
126126
IsBinary = true;
127-
System.IO.MemoryStream ms = new System.IO.MemoryStream();
128-
contents.CopyTo(ms);
129-
Contents = ms.ToArray();
127+
Contents = contents.ToArray();
130128
FileName = fileName;
131129
MimeType = mimeType;
132130
}

0 commit comments

Comments
 (0)