I'm performing file uploads from Javascript. The file is transferred fine, but the additional form data passed in the request is not bound to the request DTO.
From Chrome inspector:
------WebKitFormBoundaryunl7tsdqzGBvtsUH
Content-Disposition: form-data; name="albumId"
1037
------WebKitFormBoundaryunl7tsdqzGBvtsUH
Content-Disposition: form-data; name="file"; filename="Tulips.jpg"
Content-Type: image/jpeg
RequestDTO
public class UploadRequest : IRequiresRequestStream
{
public Stream RequestStream { get; set; }
public string FileName { get; set; }
public long? AlbumId { get; set; }
}
The image is properly bound, but other items from form-data. What's interesting is that Request.FormData contains the entry for albumId.
Any clues ?