Skip to content

Commit

Permalink
Revise article
Browse files Browse the repository at this point in the history
  • Loading branch information
KinJih  authored and KinJih  committed Dec 24, 2023
1 parent 3cba7dd commit 336ac65
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ private FormStream.SectionResult ProcessField(byte[] bytes, int pos)
```

`Write()` 方法會遍歷 HTTP form-data,搜尋邊界字串並解析每個欄位的標頭。 要觸發 `ProcessField()` 方法,必須滿足以下條件:
1. `this._inField` 必須為 true.
2. multipart 欄位的標頭不能包含 `filename` 以及 `Content-Disposition`.
3. `this._inFile` 必須是 false.
1. `this._inField` 必須為 `true`
2. multipart 欄位的標頭不能包含 `filename` 以及 `Content-Disposition`
3. `this._inFile` 必須是 `false`

```C#
public override void Write(byte[] bytes, int offset, int count)
Expand Down Expand Up @@ -175,7 +175,7 @@ public override void Write(byte[] bytes, int offset, int count)
```

### UploadModule Class
`UploadModule` 確定傳入的 HTTP 請求是否是 multipart 檔案上傳。如果是,`Context_AcquireRequestState()` 方法將建立一個`FormStream`物件,該物件會呼叫 `Write()` 方法來處理請求
`UploadModule` 確定傳入的 HTTP 請求是否是 multipart 檔案上傳。如果是 multipart 檔案上傳,`Context_AcquireRequestState()` 方法將會建立一個`FormStream`物件,該物件會呼叫 `Write()` 方法來處理此請求

```C#
public class UploadModule : IHttpModule
Expand Down

0 comments on commit 336ac65

Please sign in to comment.