0

We're just starting to use Filepicker.io in a project and had a question about rendering thumbnails. Our first test image does not appear to be recognized by Twitter as an image. This means that all the user will see is a link instead of the thumbnail.

Is there any way around this behaviour, perhaps with some sort of custom URL or optional parameter?

UPDATE

Here's the code I'm using:

<div class="upload-image">Drop files here</div>

// init filepicker plugin
filepicker.makeDropPane($('.upload-image'), {
    multiple: true,
    dragEnter: function() {
        $(".upload-image").html("Drop to upload").css({
            'backgroundColor': "#E0E0E0",
            'border': "1px solid #000"
        });
        console.log('enter');
    },
    dragLeave: function() {
        $(".upload-image").html("Drop files here").css({
            'backgroundColor': "#F6F6F6",
            'border': "1px dashed #666"
        });
    },
    onSuccess: function(fpfiles) {
        $(".upload-image").text("Done, see result below");
        $.sticky('Your file was uploaded successfully.');
        console.log(JSON.stringify(fpfiles));
    },
    onError: function(type, message) {
        // $("#localDropResult").text('('+type+') '+ message);
        $.sticky('Your file was uploaded successfully.');
    },
    onProgress: function(percentage) {
        $(".upload-image").text("Uploading ("+percentage+"%)");
    }
});
4

1 回答 1

0

如果 twitter(或实际上任何其他服务)正在执行简单的正则表达式、基于 url 的文件是否是图像的确定,您可以做的一件事是在图像的末尾附加一个 +filename.jpg。例如:

https://www.filepicker.io/api/file/JhJKMtnRDW9uLYcnkRKWhttps://www.filepicker.io/api/file/JhJKMtnRDW9uLYcnkRKW+fry.png

两者都指向相同的内容,但 twitter 可能更喜欢第二个。

于 2013-05-03T01:38:33.433 回答