mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
refactor(dropbox) uploadFile
This commit is contained in:
parent
090509ad0e
commit
8d968700ae
1 changed files with 13 additions and 11 deletions
|
|
@ -133,23 +133,25 @@ var CloudCmd, Util, DOM, CloudFunc, Dropbox, cb, Client;
|
|||
/**
|
||||
* upload file to DropBox
|
||||
*/
|
||||
this.uploadFile = function(pParams, pCallBack){
|
||||
var lContent = pParams.data,
|
||||
lName = pParams.name;
|
||||
this.uploadFile = function(params, callback){
|
||||
var data = params.data,
|
||||
name = params.name;
|
||||
|
||||
if(lContent){
|
||||
DOM.Images.showLoad();
|
||||
if(!lName)
|
||||
lName = Util.getDate();
|
||||
if (data) {
|
||||
if (!name)
|
||||
name = Util.getDate();
|
||||
|
||||
Client.writeFile(lName, lContent, function(pError, pData){
|
||||
DOM.Images.showLoad();
|
||||
|
||||
Client.writeFile(name, data, function(error, data){
|
||||
DOM.Images.hide();
|
||||
Util.log(pError || pData);
|
||||
Util.exec(pCallBack);
|
||||
|
||||
Util.log(error || data);
|
||||
Util.exec(callback);
|
||||
});
|
||||
}
|
||||
|
||||
return lContent;
|
||||
return this;
|
||||
};
|
||||
|
||||
function readDir(dirPath, callback) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue