0
在使用以下代碼下載文件時,它令我感到驚訝,它成功地下載.jpg .txt文件但是.dgn格式文件返回IO錯誤#2038FileReference.download()適用於.jpg .txt,但不適用於.dgn文件
有人可以給我任何建議嗎?提前致謝。
protected function init(event:FlexEvent):void
{
fileRef = new FileReference();
fileRef.addEventListener(Event.COMPLETE, doEvent);
fileRef.addEventListener(HTTPStatusEvent.HTTP_STATUS, doEvent);
fileRef.addEventListener(IOErrorEvent.IO_ERROR, doEvent);
fileRef.addEventListener(SecurityErrorEvent.SECURITY_ERROR, doEvent);
}
private function doEvent(evt:Event):void
{
var fr:FileReference = evt.currentTarget as FileReference;
switch (evt.type)
{
case "complete":
Alert.show("File : " + fr.name + " download succeed");
break;
default :
Alert.show("Error occur during downloading !!!");
break;
}
protected function downLoadLICMap(event:MouseEvent):void
{
urlReq = new URLRequest("http://svygis/viewphoto/ceddphoto/20130916 raw/1se19d.dgn");
fileRef.download(urlReq);
}
而不是服務器設置:是否爲.dgn擴展名配置了MIME類型?你有沒有嘗試直接在瀏覽器中打開該URL? (附註:這個URL中有一個空格;不是一個好主意) – RIAstar
我爲dgn文件添加了MIME類型「application/octet-stream」,它工作正常。非常感謝 – user2450795
如何將您的建議標記爲答案?我在這裏是新的 – user2450795