怎么将fckeditor上传图片的路径存储在数据库里
我在后台用FCKEditor发布文章,在上传图片后,想设置成“图片新闻”之类的,在FCKEditor编辑器下面放一个文本框,请问大家,如何在上传完成的同时由系统自动把上传...
我在后台用FCKEditor发布文章,在上传图片后,想设置成“图片新闻”之类的,在FCKEditor编辑器下面放一个文本框,请问大家,如何在上传完成的同时由系统自动把上传图片的路径和文件名同时填入到这个文本框里面,以便一同写进数据库??我用的ASP
展开
展开全部
<asp:TextBox ID="Content" runat="server" Height="48px" TextMode="MultiLine"
Width="174px"></asp:TextBox>
<script type="text/javascript">
// CKEDITOR.replace('<%=Content.ClientID%>', {});
var editor = CKEDITOR.replace('<%= Content.ClientID %>',
{
filebrowserBrowseUrl: '../ckfinder/ckfinder.html',
filebrowserImageBrowseUrl: '../ckfinder/ckfinder.html?Type=Images',
filebrowserFlashBrowseUrl: '../ckfinder/ckfinder.html?Type=Flash',
filebrowserUploadUrl: '../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',
filebrowserImageUploadUrl: '../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
filebrowserFlashUploadUrl: '../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
}
);
CKFinder.SetupCKEditor(editor, '/ckfinder/'); //结合上传控件
</script>
var editor = CKEDITOR.replace('<%= Content.ClientID %>',这句话的意思就是将文本框的值绑定给编辑器啊,直接保存content文本框的值就可以了,而且保存到数据库里面的是html代码,读取出来的也是html代码
Width="174px"></asp:TextBox>
<script type="text/javascript">
// CKEDITOR.replace('<%=Content.ClientID%>', {});
var editor = CKEDITOR.replace('<%= Content.ClientID %>',
{
filebrowserBrowseUrl: '../ckfinder/ckfinder.html',
filebrowserImageBrowseUrl: '../ckfinder/ckfinder.html?Type=Images',
filebrowserFlashBrowseUrl: '../ckfinder/ckfinder.html?Type=Flash',
filebrowserUploadUrl: '../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',
filebrowserImageUploadUrl: '../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
filebrowserFlashUploadUrl: '../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
}
);
CKFinder.SetupCKEditor(editor, '/ckfinder/'); //结合上传控件
</script>
var editor = CKEDITOR.replace('<%= Content.ClientID %>',这句话的意思就是将文本框的值绑定给编辑器啊,直接保存content文本框的值就可以了,而且保存到数据库里面的是html代码,读取出来的也是html代码
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询