このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
slim:4:cookbook [2020/10/13 21:26] y2sunlight [Access-Control-Allow-Methods] |
slim:4:cookbook [2020/10/13 21:59] y2sunlight [Uploading files using POST forms] |
||
---|---|---|---|
行 301: | 行 301: | ||
==== Access-Control-Allow-Credentials ==== | ==== Access-Control-Allow-Credentials ==== | ||
- | If the request contains credentials (cookies, authorization headers or TLS client certificates), | + | リクエストに資格情報(Cookie、承認ヘッダー、またはTLSクライアント証明書)が含まれている場合は、レスポンスオブジェクトに '' |
- | + | ||
- | 要求に資格情報(Cookie、承認ヘッダー、またはTLSクライアント証明書)が含まれている場合は、応答オブジェクトに '' | + | |
<code php> | <code php> | ||
行 311: | 行 309: | ||
\\ | \\ | ||
- | ===== Uploading files using POST forms ===== | + | ===== POSTフォームを使ったファイルのアップロード |
- | + | ||
- | Files that are uploaded using forms in POST requests can be retrieved with the Request method getUploadedFiles(). | + | |
POSTリクエストのフォームを使用してアップロードされたファイルは、Requestメソッド '' | POSTリクエストのフォームを使用してアップロードされたファイルは、Requestメソッド '' | ||
- | |||
- | When uploading files using a POST request, make sure your file upload form has the attribute '' | ||
POSTリクエストを使用してファイルをアップロードする場合は、ファイルアップロードフォームに属性 '' | POSTリクエストを使用してファイルをアップロードする場合は、ファイルアップロードフォームに属性 '' | ||
- | If multiple files are uploaded for the same input name, add brackets after the input name in the HTML, otherwise only one uploaded file will be returned for the input name by getUploadedFiles(). | + | 同じ |
- | + | ||
- | 同じ入力名に対して複数のファイルがアップロードされる場合は、HTMLの入力名の後に括弧を追加します。そうでない場合、'' | + | |
- | + | ||
- | Below is an example HTML form that contains both single and multiple file uploads. | + | |
以下は、単一ファイルと複数ファイルの両方のアップロードを含むHTMLフォームの例です。 | 以下は、単一ファイルと複数ファイルの両方のアップロードを含むHTMLフォームの例です。 | ||
行 356: | 行 346: | ||
</ | </ | ||
</ | </ | ||
- | |||
- | Uploaded files can be moved to a directory using the moveTo method. Below is an example application that handles the uploaded files of the HTML form above. | ||
アップロードされたファイルは、'' | アップロードされたファイルは、'' |