lib/upyun.js
function(callback) {
            spidex.put(self.baseUri + "/" + uploadFilename, {
                data: rawData,
                header: header,
                charset: "utf8"
            }, function(html, status, respHeader) {
                if(200 !== status && 201 !== status) {
                    return callback(new Error(html.replace("</h1>", "</h1> ").stripTags()));
                }

                var result = {};
                if(respHeader["x-upyun-width"] !== undefined) result.width = parseInt(respHeader["x-upyun-width"]);
                if(respHeader["x-upyun-height"] !== undefined) result.height = parseInt(respHeader["x-upyun-height"]);
                if(respHeader["x-upyun-frames"] !== undefined) result.frames = parseInt(respHeader["x-upyun-frames"]);
                if(respHeader["x-upyun-file-type"] !== undefined) result.type = respHeader["x-upyun-file-type"];

                callback(undefined, result);
            }).on("error", callback);
        }
function(callback) {
            spidex.put(self.baseUri + "/" + uploadFilename, {
                data: rawData,
                header: header,
                charset: "utf8"
            }, function(html, status, respHeader) {
                if(200 !== status && 201 !== status) {
                    return callback(new Error(html.replace("</h1>", "</h1> ").stripTags()));
                }

                var result = {};
                if(respHeader["x-upyun-width"] !== undefined) result.width = parseInt(respHeader["x-upyun-width"]);
                if(respHeader["x-upyun-height"] !== undefined) result.height = parseInt(respHeader["x-upyun-height"]);
                if(respHeader["x-upyun-frames"] !== undefined) result.frames = parseInt(respHeader["x-upyun-frames"]);
                if(respHeader["x-upyun-file-type"] !== undefined) result.type = respHeader["x-upyun-file-type"];

                callback(undefined, result);
            }).on("error", callback);
        }
function ( callback ) { spidex . put ( self . baseUri + "/" + uploadFilename , { data : rawData , header : header , charset : "utf8" } , function ( html , status , respHeader ) { if ( 200 !== status && 201 !== status ) { return callback ( new Error ( html . replace ( "</h1>" , "</h1> " ) . stripTags ( ) ) ) ; } var result = { } ; if ( respHeader [ "x-upyun-width" ] !== undefined ) result . width = parseInt ( respHeader [ "x-upyun-width" ] ) ; if ( respHeader [ "x-upyun-height" ] !== undefined ) result . height = parseInt ( respHeader [ "x-upyun-height" ] ) ; if ( respHeader [ "x-upyun-frames" ] !== undefined ) result . frames = parseInt ( respHeader [ "x-upyun-frames" ] ) ; if ( respHeader [ "x-upyun-file-type" ] !== undefined ) result . type = respHeader [ "x-upyun-file-type" ] ; callback ( undefined , result ) ; } ) . on ( "error" , callback ) ; }
use upyun api to upload the file and get result
@param callback
use upyun api to upload the file and get result