我想上傳圖片使用Flex到ImageShack的,但不斷收到ImageShack的上傳和wrong_file_type
<links>
<error id="wrong_file_type">Wrong file type detected for file IMG_00000009.jpg:application/octet-stream</error>
</links>
我試圖改變MIME類型,但似乎沒有相當做到這一點。
這裏是我的方法是這樣的:
protected function onUpload(event:MouseEvent):void
{
trace('uploading')
fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, completeHandler);
var params:URLVariables = new URLVariables();
params.key = key;
var request:URLRequest = new URLRequest("http://www.imageshack.us/upload_api.php");
request.method = URLRequestMethod.POST;
request.data = params;
fileRef.upload(request, "fileupload");
}
任何人都可以在這裏給我的手,告訴我,我,M做錯了嗎?我已經看過所有圍繞谷歌和這裏,但無法找到任何解決方法他的動作。
在此先感謝
這正是我最終做的,所以我會將這個標記爲相關答案。關於我在這裏所做的更多細節:http://stackoverflow.com/questions/7298842/uploading-bytearray-via-urlrequest無論如何 –