0

我正在尝试发布图片网址,结果是这样的=

https://www.filepicker.io/api/file/GEghdsg4Shy7aY0xY6ywc

而我想要的是

https://www.filepicker.io/api/file/asdf8dsf7asdfasdf.png

为此破坏了我使用的 Fancy Box 代码,因为它正在检查它是否是该插件中的图像。

我的代码如下 -

$(function(){
 filepicker.setKey('myKey');
   $("#newImage").on('click',function(){
         filepicker.pick({mimetypes: ['image/*'],},function(FPFile) {
       var imgU = FPFile.url;
       var text=$('#text_editor_textarea');
    text.val(text.val()+'[img]'+imgU+'[/img]');
   });
 });
});

我尝试了 FPFile.url 的其他方法,老实说,我似乎找不到解析图像 url 而不是托管位置 url 的正确方法。

4

1 回答 1

1

Filepicker 将忽略 + 之后的内容,因此您可以在 URL 中的 + 之后添加任何您想要的内容。

EG 两者都将正确解决。

https://www.filepicker.io/api/file/GEghdsg4Shy7aY0xY6ywc

https://www.filepicker.io/api/file/GEghdsg4Shy7aY0xY6ywc+whateveryouwant.png

于 2013-05-20T17:44:47.113 回答