summaryrefslogtreecommitdiffstats
path: root/afm-client/bower_components/jszip/documentation/api_jszip/file_name.md
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2016-01-28 16:30:12 +0100
committerFulup Ar Foll <fulup@iot.bzh>2016-01-28 16:30:12 +0100
commitbe83a8f382cf2fea98161bfd6d51719aacbf9aa9 (patch)
tree3fb02337f8d7d308ef7ca7818ecc3d3a6ee05d88 /afm-client/bower_components/jszip/documentation/api_jszip/file_name.md
parent1a4ed39bf86b2115eb0f1387d1e988462b492776 (diff)
Update JSON API
Diffstat (limited to 'afm-client/bower_components/jszip/documentation/api_jszip/file_name.md')
-rw-r--r--afm-client/bower_components/jszip/documentation/api_jszip/file_name.md46
1 files changed, 46 insertions, 0 deletions
diff --git a/afm-client/bower_components/jszip/documentation/api_jszip/file_name.md b/afm-client/bower_components/jszip/documentation/api_jszip/file_name.md
new file mode 100644
index 0000000..88b6d43
--- /dev/null
+++ b/afm-client/bower_components/jszip/documentation/api_jszip/file_name.md
@@ -0,0 +1,46 @@
+---
+title: "file(name)"
+layout: default
+section: api
+---
+
+__Description__ : Get a file with the specified name. You can specify folders
+in the name : the folder separator is a forward slash ("/").
+
+__Arguments__
+
+name | type | description
+-----|--------|-------------
+name | string | the name of the file.
+
+__Returns__ : An instance of [ZipObject]({{site.baseurl}}/documentation/api_zipobject.html) representing
+the file if any, `null` otherwise.
+
+__Throws__ : Nothing.
+
+<!-- __Complexity__ : This is a simple lookup in **O(1)**. -->
+
+__Examples__
+
+```js
+var zip = new JSZip();
+zip.file("file.txt", "content");
+
+zip.file("file.txt").name // "file.txt"
+zip.file("file.txt").asText() // "content"
+zip.file("file.txt").options.dir // false
+
+// utf8 example
+var zip = new JSZip(zipFromAjaxWithUTF8);
+zip.file("amount.txt").asText() // "€15"
+zip.file("amount.txt").asArrayBuffer() // an ArrayBuffer containing €15 encoded as utf8
+zip.file("amount.txt").asUint8Array() // an Uint8Array containing €15 encoded as utf8
+
+// with folders
+zip.folder("sub").file("file.txt", "content");
+zip.file("sub/file.txt"); // the file
+// or
+zip.folder("sub").file("file.txt") // the file
+```
+
+