I am trying to upload the files using the HTML5 features. As per the investigation i have found that there are 3 different ways of uploading the files,
- By encoding file as multipart: This is done when there is support for file reader only.
- Send binary data using XMLHTTP2(AJAX) spec method: New method send(Blob/File) is able to send the binary data across the wire.
- FormData object: Using XMLHTTP(AJAX) send(FormData) method.
Now for cross browser issues and feature detections snippet like below is simple,
if(typeof FileReader == "undefined")
However i am not sure how to find out if send() method of the AJAX in current browser is supporting send(FormData)
or send(Blob/File)
method implementation. How to find it ? Is there is Object.property trick here ? Or something different ?
Thanks,