Skip to content

Commit b10d8a9

Browse files
Add request timeout section to upload documentation (#1907)
* Add section about request timeout to upload plugin documentation * typo * typo * better wording * Update docusaurus/docs/dev-docs/plugins/upload.md --------- Co-authored-by: Pierre Wizla <[email protected]>
1 parent b515cb8 commit b10d8a9

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

docusaurus/docs/dev-docs/plugins/upload.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,51 @@ export default {
172172

173173
</Tabs>
174174

175+
### Upload request timeout
176+
177+
By default, the value of `strapi.server.httpServer.requestTimeout` is set to 330 seconds. This includes uploads. To make it possible for users with slow internet connection to upload large files, it might be required to increase this timeout limit. The recommended way to do it is by setting the `http.serverOptions.requestTimeout` parameter in the `config/server.js|ts` file (see [server configuration](/dev-docs/configurations/server).
178+
An alternate method is to set the `requestTimeout` value in the `bootstrap` function that runs before Strapi gets started. This is useful in cases where it needs to change programmatically — for example, to temporarily disable and re-enable it:
179+
180+
181+
<Tabs groupId="js-ts">
182+
183+
<TabItem value="javascript" label="JAVASCRIPT">
184+
185+
```js title="path: ./index.js"
186+
187+
module.exports = {
188+
189+
//...
190+
191+
bootstrap({ strapi }) {
192+
// Set the requestTimeout to 1,800,000 milliseconds (30 minutes):
193+
strapi.server.httpServer.requestTimeout = 30 * 60 * 1000;
194+
},
195+
};
196+
```
197+
198+
</TabItem>
199+
200+
<TabItem value="typescript" label="TYPESCRIPT">
201+
202+
```ts title="path: ./index.ts"
203+
204+
export default {
205+
206+
//...
207+
208+
bootstrap({ strapi }) {
209+
// Set the requestTimeout to 1,800,000 milliseconds (30 minutes):
210+
strapi.server.httpServer.requestTimeout = 30 * 60 * 1000;
211+
},
212+
};
213+
```
214+
215+
</TabItem>
216+
217+
</Tabs>
218+
219+
175220
### Responsive Images
176221

177222
When the `Enable responsive friendly upload` setting is enabled in the settings panel the plugin will generate the following responsive image sizes:

0 commit comments

Comments
 (0)