In js sample,there is nothing to show about how to download file.
I put a file (.apk) to file storage,
$(document).on("api:files:ready", function () { console.log("api:files:ready",body); dreamfactory.files.getFile({"container": "downloads", file_path: 'bak.apk',download:true}) .then(function (response) {
// console.log(“success”,response.responseText);
console.log(“success”,response);
},
function (error) {
console.error(“fail”,error.responseText);
}); });
I just want download! (response file),but I find there is only three type(son,xml,text)could be set to content type.
return $.ajax({
url: BASE_PATH + newPath,
beforeSend: function (request) {
request.setRequestHeader(“X-DREAMFACTORY-APPLICATION-NAME”, APP_NAME);
request.setRequestHeader(“X-DREAMFACTORY-SESSION-TOKEN”, sessionStorage.SESSION_TOKEN);
request.setRequestHeader(“Content-Type”, “application/vnd.android.package-archive”);
request.setRequestHeader(“Accept”, “application/vnd.android.package-archive”);
},
method: method.method,
contentType: “application/vnd.android.package-archive; charset=utf-8”,
dataType: “apk”,
processData: processData,
data: newdata,
cache: false
});
this code seems not work.could provide a demo about how to use file.thanks