使用 fckeditor 上传图片

mayflowers posted @ 2008年8月19日 20:05 in .net with tags fckeditor aspx , 3093 阅读

需要一个图片浏览上传的功能,就是 fckeditor 那种,看了半天 fckeditor,也还是不知道怎么拿出来单独用。上网搜了下找到了这篇:


http://www.cnblogs.com/alby/archive/2006/05/17/402678.html

 

按照这篇文章的说法做,点击“浏览服务器”,提示错误,仔细看了下错误提示(很长),大概说找不到:/FCKeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx, 看了一下 connector.aspx 应该是 /FCKeditor/editor/filemanager/connectors/aspx/connector.aspx,于是试着修改了下 Type=Image&Connector=connectors/aspx/connector.aspx 为:Type=Image&Connector=/FCKeditor/editor/filemanager/connectors/aspx/connector.aspx,OK了。我想问题可能是因为版本不一样: 我用的是 2.6.1,而那篇文章中的是2.2 。

代码如下:

 

<script language="javascript">
function openFileBrowser(url, width, height )
{
     var iLeft = ( window.ScreenWidth  - width ) / 2 ;
     var iTop  = ( window.ScreenHeiht - height ) / 2 ;

     var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes" ;
     sOptions += ",width=" + width ;
     sOptions += ",height=" + height ;
     sOptions += ",left=" + iLeft ;
     sOptions += ",top=" + iTop ;

     var oWindow = window.open( url, '服务器文件浏览', sOptions  ) ;
}


function SetUrl( url, width, height, alt )
{
      if(document.getElementById('txt_PicUrl_Insert')!=null)
      {
          document.getElementById('txt_PicUrl_Insert').value = url ;
      }
      else
     {
         alert("对象赋值失败:对象不存在!");
     }
}
</script>

<form runat="server">
<asp:TextBox id="pic_url" runat="server"></asp:TextBox>
<input type="button" id="btn_OpenFileBrowser_Insert" onclick="openFileBrowser('/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/fckeditor/editor/filemanager/connectors/aspx/connector.aspx',800,600);" type="button" value="浏览服务器" />
</form>

 

Telangana 10th Class 说:
2022年8月24日 12:47

TS SSC Question Paper 2023 Download Telangana 10th Class Exam New Model Paper 2023, Telangana TS SSC 10th Class Question Paper 2023 Download official website bsetelangana.org, TS 10th class exam final public Previous Question Paper 2023, <a href="https://www.li9.in/ts-ssc-question-paper-pdf/">Telangana 10th Class Model Paper 2023 PDF</a> Telangana Board of Secondary Education has been released their academic year 2023 Previous Question Paper on their official website bsetelangana.org in the month of November 2023.

11th Exam Pattern 20 说:
2023年2月13日 16:04

Board of School Education Announced the Board 11th class Blueprint. It is the responsibility of schools to conduct the examination at their own pace and decide the New Blueprint. 11th Exam Pattern 2024 Get the latest 1st Inter Blueprint 2024 and Download the Board 11th Blueprint on its official website. Blueprint 2024 for 11th Class and start preparation according to the exam New Blueprint 2024 to score in Board exam.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter