uploadTop
void upload()
Upload the item
Show/Hide Code
<script type="text/javascript">
function foo()
{
var upload_items = kul.getItems();//Return all items list
for (var i in upload_items)
{
if(upload_items[i].getStatus()=="ready")
{
//Upload all items which are ready to upload
upload_items[i].upload();
}
}
}
</script>
Supported from version: 1.0.0.0
removeTop
void remove()
Remove the item from list
Show/Hide Code
<script type="text/javascript">
function foo()
{
var items = kul.getItems();//Return all items list
for (var i in items)
{
if(items[i].getStatus()=="failed")
{
//Remove all items which are failed to upload
items[i].remove();
}
}
}
</script>
Supported from version: 1.0.0.0
cancelTop
void cancel()
Upload the item
Show/Hide Code
<script type="text/javascript">
function foo()
{
var items = kul.getItems();//Return all items list
for (var i in items)
{
if(items[i].getStatus()=="uploading")
{
//Cancel all items which are uploading
items[i].cancel();
}
}
}
</script>
Supported from version: 1.0.0.0
getStatusTop
string getStatus()
Get the item's status.
Return value:
"ready": File item has been added and ready to upload
"uploading": File item is uploading
"uploaded": File item is uploaded successfully
"failed": File item is failed to upload
Show/Hide Code
<script type="text/javascript">
function foo()
{
var items = kul.getItems();//Return all items list
for (var i in items)
{
alert(items[i].getFileName() + "is" + items[i].getStatus());
//Return: "mypic.gif is uploaded"
}
}
</script>
Supported from version: 1.0.0.0
getFileNameTop
string getFileName()
Get the name of file
Show/Hide Code
<script type="text/javascript">
function foo()
{
var items = kul.getItems();//Return all items list
for (var i in items)
{
alert(items[i].getFileName() + "is" + items[i].getStatus());
//Return: "mypic.gif is uploaded"
}
}
</script>
Supported from version: 1.0.0.0
getTotalBytesTop
int getTotalBytes()
Get total bytes or filesize
Show/Hide Code
<script type="text/javascript">
kul.registerEvent("OnUpdateProgress",function(sender,arg){
//Alert total bytes of file on the event of progress updating
alert(kul.getItem(arg.ItemId).getTotalBytes());
});
</script>
Supported from version: 1.0.0.0
getUploadedBytesTop
int getUploadedBytes()
Get number of bytes have been uploaded
Show/Hide Code
<script type="text/javascript">
kul.registerEvent("OnUpdateProgress",function(sender,arg){
//Alert uploaded bytes of file on the event of progress updating
alert(kul.getItem(arg.ItemId).getUploadedBytes());
});
</script>
Supported from version: 1.0.0.0
getEstimatedTimeTop
int getEstimatedTime()
Get total estimated time to finish this item upload
Show/Hide Code
<script type="text/javascript">
kul.registerEvent("OnUpdateProgress",function(sender,arg){
//Alert estimated time on the event of progress updating
alert(kul.getItem(arg.ItemId).getEstimatedTime());
});
</script>
Supported from version: 1.0.0.0
getElapsedTimeTop
int getElapsedTime()
Get the elapsed uploading time.
Show/Hide Code
<script type="text/javascript">
kul.registerEvent("OnUpdateProgress",function(sender,arg){
//Alert elapsed time on the event of progress updating
alert(kul.getItem(arg.ItemId).getElapsedTime());
});
</script>
Supported from version: 1.0.0.0
getEstimatedTimeLeftTop
int getEstimatedTimeLeft()
Get estimated time remaining to finish the upload
Show/Hide Code
<script type="text/javascript">
kul.registerEvent("OnUpdateProgress",function(sender,arg){
//Alert estimated time left on the event of progress updating
alert(kul.getItem(arg.ItemId).getEstimatedTimeLeft());
});
</script>
Supported from version: 1.0.0.0
getLastSpeedTop
int getLastSpeed()
Get the last uploading speed
Show/Hide Code
<script type="text/javascript">
kul.registerEvent("OnUpdateProgress",function(sender,arg){
//Alert latest uploading speed on the event of progress updating
alert(kul.getItem(arg.ItemId).getLastSpeed());
});
</script>
Supported from version: 1.0.0.0
getAverageSpeedTop
int getAverageSpeed()
Get the average uploading speed
Show/Hide Code
<script type="text/javascript">
kul.registerEvent("OnUpdateProgress",function(sender,arg){
//Alert average uploading speed on the event of progress updating
alert(kul.getItem(arg.ItemId).getAverageSpeed());
});
</script>
Supported from version: 1.0.0.0
getUploadedPercentTop
int getUploadedPercent()
Get uploading completion percent
Show/Hide Code
<script type="text/javascript">
kul.registerEvent("OnUpdateProgress",function(sender,arg){
//Alert uploading percent on the event of progress updating
alert(kul.getItem(arg.ItemId).getUploadedPercent());
});
</script>
Supported from version: 1.0.0.0
setProgessTextTop
void setProgessText(string text)
Set the text near progress bar
Show/Hide Code
<script type="text/javascript">
kul.registerEvent("OnUpdateProgress",function(sender,arg){
//Show the uploaded progress percent
var item = kul.getItem(arg.ItemId);
item.setProgessText(item.getUploadedPercent() + "%");
});
</script>
Supported from version: 1.0.0.0
attachDataTop
void attachData(string text)
Attach extra data along with uploaded item
Show/Hide Code
<script type="text/javascript">
kul.registerEvent("OnBeforeUpload",function(sender,arg){
//Attach the folder information before the file is uploaded.
//This info will able to achieve at server-side by $_POST["folder"]
var item = kul.getItem(arg.ItemId);
item.attachData("folder","temp/user1");
return true;
});
</script>
Supported from version: 1.2.0.7