EasyUI Forum
March 28, 2024, 05:44:03 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Could you add an new plugin to upload file?  (Read 7512 times)
qianet
Newbie
*
Posts: 9


View Profile Email
« on: June 13, 2017, 01:11:47 PM »

 ;DCould you add an new plugin to upload file?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 14, 2017, 02:02:47 AM »

The 'filebox' component allows you to update files to remote server. Please look at this example https://www.jeasyui.com/demo/main/index.php?plugin=FileBox&theme=default&dir=ltr&pitem=&sort=
Logged
qianet
Newbie
*
Posts: 9


View Profile Email
« Reply #2 on: June 18, 2017, 07:58:46 AM »

Thanks for you replay.
but, I want to get a upload file plugin like "http://www.uploadify.com/".
 Smiley

an plugin in easyui framework.
my projects only use one framework. Smiley
Logged
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« Reply #3 on: June 19, 2017, 01:05:41 AM »

Hello
as Stworthy said, you already have upload file plugin.
You have detailed demo how to iplement it (on link Stworthy posted).
It is jEasyUI plugin so you do not need another framework.
Logged
proceno72
Newbie
*
Posts: 39



View Profile
« Reply #4 on: June 20, 2017, 05:37:01 AM »

If it can help you, this is how I'm using "upload file" plugin:
Code:
<div style="width: 300px;">
<form enctype="multipart/form-data" id="id-ff" name="id-ff" method="post">
<table border="0" style="width:100%">
<tr>
<td><input id="id-fb" name="userfile[]" type="text" style="width: 100%;"></td>
<td style="width: 90px; text-align: right;"><a id="id-btn-upload" href="javascript:void(0)">Upload</a></td>
</tr>
</table>
</form>
</div>
<div id="multi-purpose"></div>
<script type="text/javascript">
$(function() {
// Show a progress bar on modal window
function progressFile(method,val){
var div_id='win-progress-file';
var progress_id='progress-file';
var contenthtml = '<div id="'+progress_id+'" class="easyui-progressbar" style="width:100%;"></div>' +
'<div style="margin-top: 10px; text-align: center; font-size: 1.3em; font-weight: bold;">Uploading files</div>';
var op = method.toLowerCase();
switch (op) {
case 'show':
$("#multi-purpose").append('<div id="'+div_id+'" style="padding: 20px;"></div>');
$("#"+div_id).window({
title: 'Wait please ...',
width: 300,
resizable: false, shadow: false,
minimizable: false, maximizable: false, collapsible:false, closable: false,
modal: true,
onClose: function (event, ui) {
$("#"+div_id).window('destroy');
$("#"+div_id).remove();
},
content: contenthtml
});
break;
case 'close':
$("#"+div_id).window('close');
break;
case 'update':
$("#"+progress_id).progressbar('setValue', val);
break;

}
}

    // upload function (submit form)
    function upLoad() {
        if ($('#id-fb').textbox('getValue').length === 0) {
            $.messager.alert('Message','No files selected for upload.','error');
            return false;
        }
        $('#id-ff').form('submit', {
            url: 'manage-uploaded-files.php', //What do you want to do with files uploaded on server?
            iframe: false,
            onProgress: function (percent) {
                progressFile('update',percent);
            },
            onSubmit: function(param) {
                progressFile('show');
            },
            success: function(data){
                $('#id-ff').form('clear');
$.messager.alert('Message','Files uploaded.','info');
}
        });
    }

$('#id-fb').filebox({
buttonText: 'Browse...',
multiple: true,
icons:[{
iconCls:'icon-clear',
handler: function(e){
$(e.data.target).filebox('clear');
}
}],
onChange: function (newValue, oldValue) {
if ($(this).textbox('getValue').length > 0 ) {
$('#id-btn-upload').linkbutton('enable');
}
else { $('#id-btn-upload').linkbutton('disable'); }
}
});
$('#id-btn-upload').linkbutton({
iconCls: 'icon-upload', disabled: true, plain: true,
onClick: function() { upLoad(); }
});
$('#id-ff').form();
}
</script>
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!