1
我需要知道它從POST字典中正確獲取filedata。
我想在我的項目中使用Agile Uploader(在上傳到服務器之前在客戶端調整圖像大小)。它具有process.php文件作爲在服務器上處理圖像的示例。在該文件中:
$tmp_name = $_FILES["Filedata"]["file_name"]; // where "tmp_name" is file name
金字塔有沒有FILES
字典,我supose我必須找到圖像中POST
。但是,當我嘗試上傳圖像POST
是空的...
那麼它發送該圖像以及如何在服務器端找到它?
HTML(從他們demo採取的HTML代碼大部分):
<form action="/test" method="post" id="singularDemo" enctype="multipart/form-data">
<div id="single"></div>
</form>
<a href="#" onClick="document.getElementById('agileUploaderSWF').submit();">Submit</a>
<script type="text/javascript">
$('#single').agileUploaderSingle({
submitRedirect:'',
formId:'singularDemo',
progressBarColor:'#3b5998',
flashVars:{
firebug:true,
form_action:'/test'
}
});
</script>
的Python(金字塔代碼),只是爲了測試 - 簡單的觀點:
def test(request):
if request.method == 'POST':
pass
return {}
謝謝!
發佈您的html和python代碼。 – soulcheck
@soulcheck - 添加了html和python代碼 –