Skip to content

Commit 79810be

Browse files
committed
Merge pull request openresty#3 from mibamur/patch-1
Update README.markdown
2 parents a59373b + cb84275 commit 79810be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.markdown

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Note that at least [ngx_lua 0.7.9](https://github.com/chaoslawful/lua-nginx-modu
2929
Synopsis
3030
========
3131

32+
```lua
3233
lua_package_path "/path/to/lua-resty-redis/lib/?.lua;;";
3334

3435
server {
@@ -67,9 +68,11 @@ Synopsis
6768
';
6869
}
6970
}
71+
```
7072

7173
A typical output of the /test location defined above is:
7274

75+
```json
7376
read: ["header",["Content-Disposition","form-data; name=\"file1\"; filename=\"a.txt\"","Content-Disposition: form-data; name=\"file1\"; filename=\"a.txt\""]]
7477
read: ["header",["Content-Type","text\/plain","Content-Type: text\/plain"]]
7578
read: ["body","Hello"]
@@ -82,9 +85,11 @@ A typical output of the /test location defined above is:
8285
read: ["part_end"]
8386
read: ["eof"]
8487
read: ["eof"]
88+
```
8589

8690
You can use the [lua-resty-string](https://github.com/agentzh/lua-resty-string) library to compute SHA-1 and MD5 digest of the file data incrementally. Here is such an example:
8791

92+
```lua
8893
local resty_sha1 = require "resty.sha1"
8994
local upload = require "resty.upload"
9095

@@ -130,6 +135,7 @@ You can use the [lua-resty-string](https://github.com/agentzh/lua-resty-string)
130135
-- do nothing
131136
end
132137
end
138+
```
133139

134140
If you want to copmute MD5 sums for the uploaded files, just use the
135141
resty.md5 module shipped by the lua-resty-string library. It has

0 commit comments

Comments
 (0)