Extjs File upload using json service?

一世执手 提交于 2019-12-04 18:41:09

In Extjs, File uploads are not performed using normal 'Ajax' techniques, that is they are not performed using XMLHttpRequests. Instead a hidden element containing all the fields is created temporarily and submitted with its target set to refer to a dynamically generated, hidden which is inserted into the document but removed after the return data has been gathered.

Be aware that file upload packets are sent with the content type multipart/form and some server technologies

check : http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.Basic-method-hasUpload

Yes it's possible. You should use FileReader to get binary base64 encoded content (FileReader.readAsDataURL(Blob|File)), which you can transfer with JSON.

More insights here: http://www.html5rocks.com/en/tutorials/file/dndfiles/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!