Fineuploader S3,OnComplete上传,uuid键

时间:2018-03-22 20:22:57

标签: amazon-s3 fine-uploader

如何在onComplete回调中访问UUID生成的密钥? 目前只有原始名称,但生成的密钥也需要

new FineUploaderS3({
    options: {
        request: {
            endpoint: 
            accessKey:
            params: 
        },
        signature: {
            endpoint: 
        },
        validation: {

        },
        objectProperties: { acl: "public-read" },
        key: "uuid",  
        callbacks: {

            onComplete:(id, name )=>{
                //??? Access key?
            }
        }
    }
})

1 个答案:

答案 0 :(得分:2)

使用getUuid(id)方法获取生成的UUID。

import pandas as pd
from openpyxl.utils.dataframe import dataframe_to_rows
import openpyxl
from shutil import copyfile

template_file = 'template.xlsx' #Has numbers in row 1 already
output_file = 'output.xlsx' #What we are saving the template as

copyfile(template_file, output_file)

# Read in the data to be pasted into the termplate
df = pd.read_csv('input.csv') #to read the csv file

wb = openpyxl.load_workbook(output_file)
ws = wb.get_sheet_by_name('data') 

for r in dataframe_to_rows(df, index=False, header=False):
    ws.append(r)

wb.save(output_file)
相关问题