我在我的网站上使用 FileStack,根据 FileStack Docs 我实际上有这个:
<iframe id="framefile" width="700" height="500" frameborder="0">
<p>Your browser does not support iframes.</p>
</iframe>
<div id="files"></div>
在javascript方面:
<script src="http://code.jquery.com/jquery-1.12.0.min.js"></script>
<script type="text/javascript" src="http://api.filepicker.io/v2/filepicker.js"></script>
<script type="text/javascript">
filepicker.setKey("myAPIKey");
filepicker.pickMultiple(
{
mimetype: '*/*',
language: 'es_mx',
container: 'framefile',
services: ['COMPUTER','GOOGLE_DRIVE','DROPBOX']
},
function(Blobs){
console.log(JSON.stringify(Blobs));
},
function(FPError){
console.log(FPError.toString());
});
</script>
我只需要获取 URL 文件值并将其放入 div 中。我试过这个:
<script type="text/javascript">
filepicker.setKey("myAPIKey");
filepicker.pickMultiple(
{
mimetype: '*/*',
language: 'es_mx',
container: 'framefile',
services: ['COMPUTER','GOOGLE_DRIVE','DROPBOX']
},
function(Blobs){
console.log(JSON.stringify(Blobs));
var result = JSON.stringify(Blobs, ['url']);
$('#files').html(result);
},
function(FPError){
console.log(FPError.toString());
});
</script>
我得到这个:
[{"url":" https://cdn.filepicker.io/api/file/--link1-- "}]
但是我怎样才能获得 URL 值但以这种方式?:
有人有解决方案吗?