mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Support http.getFile for URLs with query params
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import * as imageSourceModule from "../../image-source";
|
||||
import * as platformModule from "../../platform";
|
||||
import * as fsModule from "../../file-system";
|
||||
import { getFilenameFromUrl } from "./http-request-common";
|
||||
|
||||
// this is imported for definition purposes only
|
||||
import * as http from "../../http";
|
||||
@@ -119,11 +120,11 @@ function onRequestComplete(requestId: number, result: org.nativescript.widgets.A
|
||||
}
|
||||
});
|
||||
},
|
||||
toFile: (destinationFilePath?: string) => {
|
||||
var fs: typeof fsModule = require("file-system");
|
||||
var fileName = callbacks.url;
|
||||
toFile: (destinationFilePath: string) => {
|
||||
var fs: typeof fsModule = require("file-system");
|
||||
|
||||
if (!destinationFilePath) {
|
||||
destinationFilePath = fs.path.join(fs.knownFolders.documents().path, fileName.substring(fileName.lastIndexOf('/') + 1));
|
||||
destinationFilePath = getFilenameFromUrl(callbacks.url);
|
||||
}
|
||||
var stream: java.io.FileOutputStream;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user