0

ドロップボックスセーバーAPIを使用して複数の画像をドロップボックスに保存しようとしていますが、コードは画像を保存せず、エラーも確認もありません.(ドロップボックスセーバーウィンドウがポップアップして[保存]をクリックすると閉じますが、確認はありません! )この問題を解決する方法を教えてください。

注:この関数呼び出しを使用して 1 つの画像を保存できます。

Dropbox.save('<?PHP  echo $imagePath1_Value; ?>', 'image1.jpg', options);

完全なコード:

<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="xxxxxxxxxxxxxx"></script>
<script>

function saver(){

var options = { 

files: [
        // You can specify up to 100 files.
        // ...
        {'url': '<?PHP  echo $imagePath1_Value; ?>', 'filename': '1.jpg'},
        {'url': '<?PHP  echo $imagePath2_Value; ?>', 'filename': '2.jpg'},
        {'url': '<?PHP  echo $imagePath3_Value; ?>', 'filename': '3.jpg'},

    ],

    // Success is called once all files have been successfully added to the user's
    // Dropbox, although they may not have synced to the user's devices yet.
    success: function () {
        // Indicate to the user that the files have been saved.
        alert("Success! Files saved to your Dropbox.");
    },

    // Progress is called periodically to update the application on the progress
    // of the user's downloads. The value passed to this callback is a float
    // between 0 and 1. The progress callback is guaranteed to be called at least
    // once with the value 1.
    progress: function (progress) {},

    // Cancel is called if the user presses the Cancel button or closes the Saver.
    cancel: function () {},

    // Error is called in the event of an unexpected response from the server
    // hosting the files, such as not being able to find a file. This callback is
    // also called if there is an error on Dropbox or if the user is over quota.
    error: function (errorMessage) {}

};

Dropbox.save(options);
};
</script>
<button onclick="saver()">save(Multiple images)</button>
4

0 に答える 0