2011-02-14 45 views

回答

0

可悲的是,它可能不再是因爲在現代瀏覽器

  • 你不能上傳字段讀出的圖像的完整路徑,更多的
  • 鏈接到本地​​資源不工作了

出於安全原因。

+0

好的給出一個建議如何管理這個配置文件視圖?註冊時有一個頭像上傳,它應該顯示在PIC容器面板中。 – Navruk 2011-02-14 11:27:51

+0

@Navruk你可以在iframe中單獨上傳,或者使用基於Flash的上傳器,比如swfupload.org – 2011-02-14 11:28:45

0

您可以在iframe中放置與文件上傳相關的內容,並將該iframe包含在主頁面中。所以在文件上傳後,您可以從響應中獲取圖像路徑並在主頁面中顯示。

主頁:

<p> 
       <iframe id="ifrFileUpload" scrolling="no" frameborder="0" hidefocus="true" style="text-align: left; 
        vertical-align: middle; border-style: none; margin-right: 120px; margin-bottom: 20px; 
        float: right; width: 70%; height: 40px" src="http://site.com/FileUpload"> 
       </iframe> 

      </p> 

的IFrame:

<form id="form1" name="form1" action="http://site.com/FileUpload" enctype="multipart/form-data" 
    method="post"> 
<p> 
    <input type="file" id="file1" name="file1" /> 

    <input type="submit" value="Upload" /> 

</p> 
    </form> 

和反應,你可以調用父函數方法來顯示圖像