📜 ⬆️ ⬇️

Asynchronous file uploading implemented on YUI

Cuong Tham wrote an example demonstrating asynchronous uploading of 5 files to a server using YUI .

Code:
function init(){
var onUploadButtonClick = function(e){
//the second argument of setForm is crucial,
//which tells Connection Manager this is a file upload form
YAHOO.util.Connect.setForm('testForm', true);
var uploadHandler = {
upload: function(o) {
alert(o.responseText);
}
};
YAHOO.util.Connect.asyncRequest('POST', 'upload.php', uploadHandler);
};
YAHOO.util.Event.on('uploadButton', 'click', onUploadButtonClick);
}
YAHOO.util.Event.on(window, 'load', init);


Demo: http://test.thecodecentral.com/demos/asyncupload/
Details: http://thecodecentral.com/2007/09/04/asynchronous-file-upload-yuis-approach

')

Source: https://habr.com/ru/post/13948/


All Articles