private void FinishFileData(Entity entity) { if (uploaded_file == null) return; // Chop off the \r\n that gets appended before the boundary marker uploaded_file.Contents.SetLength (uploaded_file.Contents.Position - 2); uploaded_file.Finish (); if (uploaded_file.Length > 0) entity.Files.Add (current_name, uploaded_file); uploaded_file = null; }
public void ParseContentDisposition(string str) { current_name = GetContentDispositionAttribute (str, "name"); current_filename = GetContentDispositionAttributeWithEncoding (str, "filename"); if (!String.IsNullOrEmpty (current_filename)) uploaded_file = file_creator.Create (current_filename); }