七牛云存储 | 上传凭证

七牛云存储上凭证生成演示 author(s): Qiniu

HTML

<link rel="stylesheet" href="http://qtestbucket.qiniudn.com/demo/ext/resources/ext-theme-neptune/ext-theme-neptune-all.css">
<script src="http://qtestbucket.qiniudn.com/demo/qiniu.uploader.js?id=2"></script>
<script>
    /**
     * 断点续上传演示
     * 断点续传需要对文件进行读取,仅适合于实现了HTML5标准的浏览器
     */

    /*******************************************************************************
    *   贡献代码:
    *   1. git clone git@github.com:icattlecoder/jsfiddle
    *   2. push代码到您的github库
    *   2. 测试效果,访问 http://jsfiddle.net/gh/get/extjs/4.2/<Your GitHub Name>/jsfiddle/tree/master/resumbleupload
    *   3. 提pr
    ********************************************************************************

</script>

JavaScript

var progressbar = Ext.create('Ext.ProgressBar', {
    width: 500,
    hidden: true
});
var Bigupform = new Ext.form.Panel({
    title: "断点续上传",
    region: "center",
    fieldDefaults: {
        width: 500
    },
    id: "resumbleUpload",
    defaultType: "textfield",
    bodyPadding: 5,
    items: [{
            xtype: "fieldcontainer",
            fieldLabel: "upToken",
            width: 500,
            layout: "hbox",
            combineErrors: true,
            defaultType: "textfield",
            defaults: {
                hideLabel: "true"
            },
            items: [{
                name: "txt_upload_token",
                id: "txt_upload_token",
                xtype: "textarea",
                emptyText: "如果不知道如何生成token,可以点击右侧的链接生成,然后将结果复制粘贴过来",
                width: 310,
                height: 80,
                allowBlank: false
            }, {
                xtype: 'displayfield',
                fieldLabel: 'Visitor',
                name: 'visitor_score',
                value: '<a href="http://jsfiddle.net/gh/get/extjs/4.2/icattlecoder/jsfiddle/tree/master/uptoken" target="_blank">在线生成</a>'
            }]
        }, {
            id: "txt_upload_key",
            name: "txt_upload_key",
            emptyText: "如果您在生成token的过程中指定了key,则将其输入至此。否则留空",
            fieldLabel: "key"
        }, {
            xtype: "fieldcontainer",
            fieldLabel: "路径",
            width: 500,
            layout: "hbox",
            combineErrors: true,
            defaults: {
                hideLabel: "true"
            },
            items: [{
                xtype: 'filefield',
                name: 'photo',
                msgTarget: 'side',
                width: 345,
                allowBlank: false,
                buttonText: '选择文件',
                id: "fileselect"
            }, {
                xtype: "button",
                margins: '0 0 0 6',
                text: "上传",
                handler: function() {
                   ...