2012-04-13 97 views
0

我正在爲文章發佈頁面使用Dojo編輯器工具。我試圖測試LocalImage插件,我有一些問題。該插件加載正常,但是當我嘗試從我的計算機上選擇一個圖像上傳到服務器時,它給我一些問題。Dojo 1.7 localImage插件問題

第一:在我的電腦上選擇本地圖像後,它沒有列出完整的文件路徑。它只會列出文件名。因此,而不是C:\ pic.jpeg它只顯示pic.jpeg。如果我點擊插入Firebug給出錯誤和警告。 「NetworkError:404 Not Found - http://XXX.XXX.XXX.XXX/images/articles/uploads/test.jpeg」 不推薦使用屬性的nodeValue屬性。改爲使用值。

第二:我嘗試然後輸入本地路徑自己c:\ pic.jpeg。這次沒有錯誤。但是,只有描述標題顯示錨點。同樣來自上面的警告。 Problem 1 and 2

如果我使用圖片的URL,它的工作正常。

我試圖按照此頁面上的文檔: http://dojotoolkit.org/reference-guide/1.7/dojox/editor/plugins/LocalImage.html

editArticle.php

  <div data-dojo-type="dijit.Editor" id="editorContent" 
      data-dojo-props="extraPlugins:[{name: 'LocalImage', uploadable: true, uploadUrl: '../../../images/articles/UploadFile.php', baseImageUrl: '../../../images/articles/', fileMask: '*.jpg;*.jpeg;*.gif;*.png;*.bmp'}], 
      onChange:function(){dojo.byId('content').value = this.getValue();}" name="editorContent" placeholder="The HTML content of the article" required maxlength="100000" style="padding:0;"><?php echo $results['article']->content ?> 
     </div> 

UploadFile.php

$upload_path = "../articles/uploads/"; 
$download_path = "../articles/uploads/"; 
require("JSON.php"); 
$json = new Services_JSON(); 

cLOG.php在工作,顯示了這個生成upload.txt。

[12.04.13 1.03.32]: POSTDATA: 1 FILES 
[12.04.13 1.03.32]: 
[12.04.13 1.03.32]: file: uploadedfile=Array 
[12.04.13 1.03.32]: HTML single POST: 
[12.04.13 1.03.32]: 
[12.04.13 1.03.32]: file: ../articles/uploads/test.jpeg 
[12.04.13 1.03.32]: Json Data Returned: 
[12.04.13 1.03.32]: {"file":"..\/articles\/uploads\/test.jpeg","name":"test.jpeg","width":null,"height":null,"type":"jpeg","size":false,"additionalParams":[]} 

請幫助菜鳥!

回答

0

通過更改服務器文件夾權限修復它!