how to send file with multipart/form-data using Ajax ?

475 views
Skip to first unread message

Marek Żebrowski

unread,
Jul 3, 2015, 4:02:59 AM7/3/15
to scal...@googlegroups.com
I want to send "multipart/form-data" with file contents using Ajax.send
I'm trying to use FormData  to construct entity:
val fd = new FormData
val aFile:  File = ??? // - comes form a input element
fd.add("file", aFile, "filename")

and now I'm stuck  as there is no converter from FormData to InputData required by Ajax.apply

is there a better way to do it?

Allan Brighton

unread,
Jul 3, 2015, 6:06:42 AM7/3/15
to scal...@googlegroups.com

Marek Żebrowski

unread,
Jul 3, 2015, 6:28:07 AM7/3/15
to scal...@googlegroups.com
Thanks!
 I hoped for something more high-level, but I guess javascript itself isn't there yet.
That example should be fine.
Reply all
Reply to author
Forward
0 new messages