1
- # Next S3 Uploader
1
+ # Next.js S3 Uploader
2
+
3
+ ![ Next.js S3 File Uploader] ( Next.js-S3-Uploader.png )
4
+
5
+ ![ npm] ( https://img.shields.io/npm/dm/next-s3-uploader )
6
+ ![ npm] ( https://img.shields.io/npm/v/next-s3-uploader )
7
+ ![ GitHub] ( https://img.shields.io/github/license/abhay-ramesh/next-s3-uploader )
8
+ ![ example workflow] ( https://github.com/abhay-ramesh/next-s3-uploader/actions/workflows/release.yml/badge.svg )
9
+ <!--  -->
10
+ <!--  -->
2
11
3
12
** Next S3 Uploader** is a utility package for handling file uploads to Amazon S3 or compatible services like MinIO in a Next.js application. It simplifies the process of integrating secure and scalable cloud storage for your Next.js projects.
4
13
14
+ ## Table of Contents
15
+
16
+ - [ Next.js S3 Uploader] ( #nextjs-s3-uploader )
17
+ - [ Table of Contents] ( #table-of-contents )
18
+ - [ Features] ( #features )
19
+ - [ Installation] ( #installation )
20
+ - [ Usage] ( #usage )
21
+ - [ Frontend (Nextjs App Directory)] ( #frontend-nextjs-app-directory )
22
+ - [ API Route] ( #api-route )
23
+ - [ API] ( #api )
24
+ - [ ` useS3FileUpload ` Hook Options] ( #uses3fileupload-hook-options )
25
+ - [ ` uploadFiles ` Function Options] ( #uploadfiles-function-options )
26
+ - [ ` uploadedFiles ` Array Properties] ( #uploadedfiles-array-properties )
27
+ - [ ` reset ` Function] ( #reset-function )
28
+ - [ ` createS3Client(config) ` ] ( #creates3clientconfig )
29
+ - [ ` generatePresignedUrls(s3Client, keys, bucket, prefix?) ` ] ( #generatepresignedurlss3client-keys-bucket-prefix )
30
+ - [ Example Usage] ( #example-usage )
31
+ - [ Allow Multiple File Uploads] ( #allow-multiple-file-uploads )
32
+ - [ Limit Number of Uploaded Files] ( #limit-number-of-uploaded-files )
33
+ - [ Set Maximum File Size] ( #set-maximum-file-size )
34
+ - [ Custom Keys] ( #custom-keys )
35
+ - [ Custom API Endpoint] ( #custom-api-endpoint )
36
+ - [ AWS S3 Client] ( #aws-s3-client )
37
+ - [ Non-AWS S3 Compatible Client (MinIO/Non-AWS)] ( #non-aws-s3-compatible-client-minionon-aws )
38
+ - [ Basic File Upload] ( #basic-file-upload )
39
+ - [ Authenticated Upload] ( #authenticated-upload )
40
+ - [ Project-Specific Upload] ( #project-specific-upload )
41
+ - [ Organization/Company File Storage] ( #organizationcompany-file-storage )
42
+ - [ Contributing] ( #contributing )
43
+ - [ License] ( #license )
44
+
5
45
## Features
6
46
7
47
- ** Easy Integration** : Seamlessly integrate file upload functionality into your Next.js applications.
@@ -148,6 +188,8 @@ The `uploadFiles` function initiates file uploads to Amazon S3 and supports cust
148
188
149
189
- ` endpoint ` (optional): API endpoint for generating pre-signed URLs. Default is ` /api/s3upload ` .
150
190
191
+ - ` requestOptions ` (optional): Additional options to pass to the ` fetch ` function.
192
+
151
193
#### ` uploadedFiles ` Array Properties
152
194
153
195
The ` uploadedFiles ` array contains information about each uploaded file:
@@ -162,9 +204,11 @@ The `uploadedFiles` array contains information about each uploaded file:
162
204
163
205
- ` timeLeft ` (string): Estimate of remaining time for the upload to complete.
164
206
165
- ---
207
+ #### ` reset ` Function
208
+
209
+ The ` reset ` function resets the ` uploadedFiles ` array to its initial state. (Sets ` uploadedFiles ` to an empty array.)
166
210
167
- Sure, here's the updated description for the ` createS3Client ` function in the API reference:
211
+ ---
168
212
169
213
### ` createS3Client(config) `
170
214
0 commit comments