我在论坛软件中使用TinyMce编辑器,我想将图像上传到论坛帖子中。上传等。工作正常,但是每次我上传图片时,它都会在html中添加如下所示:
<img src="/http://localhost/MvcForum.WebImages/uploads/xxx/nb4pbdre-paddington.jpg?width=690&upscale=false" alt="" />
问题是最初的正斜杠/。这使得图像不会出现在TinyMcs编辑器中。如果我手动将其删除,则图像显示正常。
我知道我可以使用相对路径配置,这将起作用。但是我有多个论坛,他们都将图像保存到一个中央位置,因此我想使用绝对路径。 (我希望我的术语是正确的!)
我的TinyMce编辑器的设置在下面的代码段中。我相信关键设置是:
convert_urls:否, relative_urls:否, remove_script_host:否
我尝试了以上各种组合,但没有碰到运气。删除img src中的初始正斜杠有什么帮助吗?
settings = extend({
id: id,
theme: 'modern',
delta_width: 0,
delta_height: 0,
popup_css: '',
plugins: '',
add_form_submit_trigger: true,
submit_patch: true,
add_unload_trigger: true,
document_base_url: "",
convert_urls: false,
relative_urls: false,
remove_script_host: false,
object_resizing: true,
doctype: '<!DOCTYPE html>',
visual: true,
font_size_style_values: 'xx-small,x-small,small,medium,large,x-large,xx-large',
// See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size
font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%',
forced_root_block: 'p',
hidden_input: true,
padd_empty_editor: true,
render_ui: true,
indentation: '30px',
inline_styles: true,
convert_fonts_to_spans: true,
indent: 'simple',
indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' +
'tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
indent_after: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' +
'tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
validate: true,
entity_encoding: 'named',
url_converter: self.convertURL,
url_converter_scope: self,
ie7_compat: true
}, defaultSettings, settings);cdcc