Skip to content

Commit

Permalink
Merge pull request #3 from mibamur/patch-1
Browse files Browse the repository at this point in the history
Update README.markdown
  • Loading branch information
agentzh committed Oct 22, 2013
2 parents a59373b + cb84275 commit 79810be
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.markdown
Expand Up @@ -29,6 +29,7 @@ Note that at least [ngx_lua 0.7.9](https://github.com/chaoslawful/lua-nginx-modu
Synopsis
========

```lua
lua_package_path "/path/to/lua-resty-redis/lib/?.lua;;";

server {
Expand Down Expand Up @@ -67,9 +68,11 @@ Synopsis
';
}
}
```

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

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

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:

```lua
local resty_sha1 = require "resty.sha1"
local upload = require "resty.upload"

Expand Down Expand Up @@ -130,6 +135,7 @@ You can use the [lua-resty-string](https://github.com/agentzh/lua-resty-string)
-- do nothing
end
end
```

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

0 comments on commit 79810be

Please sign in to comment.