Skip to content

Commit ddad6cf

Browse files
committed
Fixed code example poor formatting in FileTransfer docs
1 parent e02de0f commit ddad6cf

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

docs/en/edge/cordova/file/filetransfer/filetransfer.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,35 +62,34 @@ __Parameters:__
6262
- __trustAllHosts__ - Optional parameter, defaults to false. If set to true then it will accept all security certificates. This is useful as Android rejects self signed security certificates. Not recommended for production use. Supported on Android and iOS. _(boolean)_
6363

6464
__Quick Example__
65-
65+
6666
// !! Assumes variable fileURI contains a valid URI to a text file on the device
67-
68-
var win = function(r) {
69-
console.log("Code = " + r.responseCode);
70-
console.log("Response = " + r.response);
71-
console.log("Sent = " + r.bytesSent);
72-
}
73-
67+
68+
var win = function(r) {
69+
console.log("Code = " + r.responseCode);
70+
console.log("Response = " + r.response);
71+
console.log("Sent = " + r.bytesSent);
72+
}
7473
var fail = function(error) {
75-
alert("An error has occurred: Code = " + error.code);
76-
console.log("upload error source " + error.source);
77-
console.log("upload error target " + error.target);
74+
alert("An error has occurred: Code = " + error.code);
75+
console.log("upload error source " + error.source);
76+
console.log("upload error target " + error.target);
7877
}
79-
80-
var options = new FileUploadOptions();
81-
options.fileKey="file";
82-
options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1);
83-
options.mimeType="text/plain";
78+
79+
var options = new FileUploadOptions();
80+
options.fileKey="file";
81+
options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1);
82+
options.mimeType="text/plain";
8483

85-
var params = {};
86-
params.value1 = "test";
87-
params.value2 = "param";
88-
89-
options.params = params;
90-
91-
var ft = new FileTransfer();
92-
ft.upload(fileURI, encodeURI("http://some.server.com/upload.php"), win, fail, options);
84+
var params = {};
85+
params.value1 = "test";
86+
params.value2 = "param";
9387

88+
options.params = params;
89+
90+
var ft = new FileTransfer();
91+
ft.upload(fileURI, encodeURI("http://some.server.com/upload.php"), win, fail, options);
92+
9493
__Full Example__
9594

9695
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

0 commit comments

Comments
 (0)