2014-10-01 19 views
0

我正在使用fineuploader-5.0.7 s3將文件直接上傳到S3。 而且我還將端點設置爲我的php後端文件。Fine上傳器S3元數據大小超過

var options = { 
    debug: true, 
    template: "qq-template-manual-noedit", 
    autoUpload: false, 
    multiple: false, 
    request: { 
     endpoint: UploadVars.endpoint, 
     accessKey: UploadVars.accessKey, 

    }, 
    signature: { 
     endpoint: "entry_essay_handler_s3.php" 
    }, 
    uploadSuccess: { 
     endpoint: "entry_essay_handler_s3.php?success" 
    }, 
    // required if non-File-API browsers, such as IE9 and older, are used 
    iframeSupport: { 
     localBlankPagePath: 'blank.html' 
    }, 
    validation: { 
     allowedExtensions: UploadVars.allowedExtensions, 
     sizeLimit: UploadVars.sizeLimit 
    }, 
    showMessage: function(message) { 
     // Using Twitter Bootstrap's classes and jQuery selector and method 
     console.log(message); 
     $('#imageUploadmsg').html(message); 
     $('#imageUploadmsg').css('visibility','visible'); 
    }, 
    objectProperties: { 
     key: function (id) { 
      return getUploadPath(id); 
     } 
    }, 
    chunking: { 
     enabled: true 
    }, 
    retry: { 
     enableAuto: true 
    }, 
    resume: { 
     enabled: true 
    }, 
    messages:{ 
     unsupportedBrowser: "You need to update your browser in order to upload a file." 
    } 
}; 

這個entry_essay_handler_s3.php將解析自定義表單元素並將它們存儲到數據庫中。 這個東西是一些字段包含超過2kb的文本,並且它與文件附件一起提交給aws。 我從aws得到這個錯誤。 您的元數據標題超過了允許的最大元數據大小 我不想將元數據提交給aws,但我應該在我的php端點中獲取元數據。

我在PHP中使用這些代碼

switch ($k): 
    case 'key': 
     $key = $val; 
     break; 
    case 'bucket': 
     $bucket = $val; 
     break; 
    case 'x-amz-meta-title': 
     $_POST['title'] = urldecode($val); 
     break; 
    case 'x-amz-meta-caption': 
     $_POST['caption'] = urldecode($val); 
     break; 
    case 'x-amz-meta-essay': 
     $_POST['essay'] = urldecode($val); 
     break; 
    case 'x-amz-meta-entry_custom1': 
     $_POST['entry_custom1'] = urldecode($val); 
     break; 
    case 'x-amz-meta-entry_custom2': 
     $_POST['entry_custom2'] = urldecode($val); 
     break; 
    case 'x-amz-meta-entry_custom3': 
     $_POST['entry_custom3'] = urldecode($val); 
     break; 
    case 'x-amz-meta-entry_custom4': 
     $_POST['entry_custom4'] = urldecode($val); 
     break; 
    case 'x-amz-meta-entry_custom5': 
     $_POST['entry_custom5'] = urldecode($val); 
     break; 
endswitch; 

回答

0

與文件關聯將被髮送到上傳端點的所有參數,在這種情況下,S3。從你的問題來看,這些參數來自哪裏並不清楚。如果您只想將參數發送到您的uploadSuccess端點,則在這種情況下,請使用setUploadSuccessParams API method

相關問題