cherryext/orun/extjs/static/extjs-upload-widget/lib/upload/header/Base64FilenameEncoder.js

16 lines
421 B
JavaScript
Raw Normal View History

2018-08-15 11:12:01 +03:00
/**
* Base64 filename encoder - uses the built-in function window.btoa().
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window.btoa
*/
Ext.define('Ext.ux.upload.header.Base64FilenameEncoder', {
extend : 'Ext.ux.upload.header.AbstractFilenameEncoder',
config : {},
type : 'base64',
encode : function(filename) {
return window.btoa(unescape(encodeURIComponent(filename)));
}
});