Explorar el Código

Update README.md

wkh237 hace 8 años
padre
commit
d534b2c409
Se han modificado 1 ficheros con 35 adiciones y 5 borrados
  1. 35
    5
      README.md

+ 35
- 5
README.md Ver fichero

24
  * [Upload file](#user-content-upload-example--dropbox-files-upload-api)
24
  * [Upload file](#user-content-upload-example--dropbox-files-upload-api)
25
  * [Multipart/form upload](#user-content-multipartform-data-example--post-form-data-with-file-and-data)
25
  * [Multipart/form upload](#user-content-multipartform-data-example--post-form-data-with-file-and-data)
26
  * [Upload/Download progress](#user-content-uploaaddownload-progress)
26
  * [Upload/Download progress](#user-content-uploaaddownload-progress)
27
- * [Show Downloaded File in Android Downloads App](#user-content-show-downloaded-file-in-android-downloads-app)
27
+ * [Show Downloaded File and Notification in Android Downloads App](#user-content-show-downloaded-file-in-android-downloads-app)
28
  * [File access](#user-content-file-access)
28
  * [File access](#user-content-file-access)
29
  * [File stream](#user-content-file-stream)
29
  * [File stream](#user-content-file-stream)
30
  * [Manage cached files](#user-content-manage-cached-files)
30
  * [Manage cached files](#user-content-manage-cached-files)
296
     })
296
     })
297
 ```
297
 ```
298
 
298
 
299
-#### Show Downloaded File in Android Downloads App
299
+#### Show Downloaded File and Notifiction in Android Downloads App
300
 
300
 
301
 When you use `config` API to store response data to file, the file won't be visible in Andoird's "Download" app, if you want to do this, some extra options in `config` is required.
301
 When you use `config` API to store response data to file, the file won't be visible in Andoird's "Download" app, if you want to do this, some extra options in `config` is required.
302
 
302
 
342
 
342
 
343
 #### File Stream
343
 #### File Stream
344
 
344
 
345
-In `v0.5.0` we've added  `writeStream` and `readStream`, which allows you read/write data from file path. This API creates a file stream, rather than convert whole data into BASE64 encoded string, it's handy when processing **large files**.
345
+In `v0.5.0` we've added  `writeStream` and `readStream`, which allows your app read/write data from file path. This API creates a file stream, rather than convert whole data into BASE64 encoded string, it's handy when processing **large files**.
346
 
346
 
347
 But there're some differences between `readStream` and `writeStream` API. When calling `readStream` method, the file stream is opened immediately, and start to read data. 
347
 But there're some differences between `readStream` and `writeStream` API. When calling `readStream` method, the file stream is opened immediately, and start to read data. 
348
 
348
 
369
 
369
 
370
 When use `writeStream`, the stream is also opened immediately, but you have to `write`, and `close` by yourself.
370
 When use `writeStream`, the stream is also opened immediately, but you have to `write`, and `close` by yourself.
371
 
371
 
372
-```
372
+```js
373
 let ofstream = RNFetchBlob.writeStream(
373
 let ofstream = RNFetchBlob.writeStream(
374
     PATH_TO_FILE, 
374
     PATH_TO_FILE, 
375
     // encoding, should be one of `base64`, `utf8`, `ascii`
375
     // encoding, should be one of `base64`, `utf8`, `ascii`
443
 
443
 
444
 #### `config(options:RNFetchBlobConfig):fetch`
444
 #### `config(options:RNFetchBlobConfig):fetch`
445
 
445
 
446
+`0.5.0`
447
+
446
 Config API was introduced in `v0.5.0` which provides some options for the `fetch` task. 
448
 Config API was introduced in `v0.5.0` which provides some options for the `fetch` task. 
447
 
449
 
448
 #### `fetch(method, url, headers, body):Promise<FetchBlobResponse>`
450
 #### `fetch(method, url, headers, body):Promise<FetchBlobResponse>`
449
 
451
 
452
+`legacy`
453
+
450
 Send a HTTP request uses given headers and body, and return a Promise.
454
 Send a HTTP request uses given headers and body, and return a Promise.
451
 
455
 
452
 #### method:`string` Required
456
 #### method:`string` Required
459
 Body of the HTTP request, body can either be a BASE64 string, or an array contains object elements, each element have 2  required property `name`, and `data`, and 1 optional property `filename`, once `filename` is set, content in `data` property will be consider as BASE64 string that will be converted into byte array later.
463
 Body of the HTTP request, body can either be a BASE64 string, or an array contains object elements, each element have 2  required property `name`, and `data`, and 1 optional property `filename`, once `filename` is set, content in `data` property will be consider as BASE64 string that will be converted into byte array later.
460
 When body is a base64 string , this string will be converted into byte array in native code, and the request body will be sent as `application/octet-stream`.
464
 When body is a base64 string , this string will be converted into byte array in native code, and the request body will be sent as `application/octet-stream`.
461
 
465
 
462
-#### `fetch(...).progress(eventListener):Promise<FetchBlobResponse>` added in `0.4.2`
466
+#### `fetch(...).progress(eventListener):Promise<FetchBlobResponse>`
467
+
468
+`0.4.2`
463
 
469
 
464
 Register on progress event handler for a fetch request.
470
 Register on progress event handler for a fetch request.
465
 
471
 
473
 
479
 
474
 #### `base64`
480
 #### `base64`
475
 
481
 
482
+`0.4.2`
483
+
476
 A helper object simply uses [base-64](https://github.com/mathiasbynens/base64) for decode and encode BASE64 data.
484
 A helper object simply uses [base-64](https://github.com/mathiasbynens/base64) for decode and encode BASE64 data.
477
 
485
 
478
 ```js
486
 ```js
482
 
490
 
483
 #### `fs`
491
 #### `fs`
484
 
492
 
493
+`0.5.0`
494
+
495
+#### `getSystemDirs()`
496
+
497
+This method returns common used folders:
498
+
499
+- DocumentDir 
500
+- CacheDir
501
+- DCIMDir (Android Only)
502
+- DownloadDir (Android Only)
503
+
504
+example 
505
+
506
+```js
507
+```
508
+
509
+If you're going to make downloaded file visible in Android `Downloads` app, please see [Show Downloaded File and Notification in Android Downloads App](#user-content-show-downloaded-file-in-android-downloads-app).
510
+
511
+#### createFile(path:string, data:string, encoding:string ):Promise
512
+
485
 TODO
513
 TODO
486
 
514
 
515
+
516
+
487
 ### Types
517
 ### Types
488
 
518
 
489
 #### RNFetchBlobConfig
519
 #### RNFetchBlobConfig