You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-3
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ The `master` branch has the code for AWS-S3 upload and the `disk-storage` branch
8
8
9
9
First start mongodb service with `sudo service mongod start` and then the following commands
10
10
11
-
- Run `npm install`
12
-
- Run `npm run dev`
13
-
- Run `npm start`
11
+
-Run `npm install`
12
+
-Run `npm run dev`
13
+
-Run `npm start`
14
14
15
15
It will start the server at [http://localhost:3000/](http://localhost:3000/)
16
16
@@ -23,3 +23,41 @@ It will start the server at [http://localhost:3000/](http://localhost:3000/)
23
23
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
24
24
25
25
[NOTE ONLY FOR ME - I HAVE TO ENTER ALL DETAILS IN .env FILE AGAIN AS I HAVE DELETED THE S3-BUCKET ]
26
+
27
+
### How to make the AWS-S3 bucket public - whithout which the upload will NOT work
28
+
29
+
If you're using an Amazon S3 bucket to share files with anyone else, you'll first need to make those files public. Maybe you're sending download links to someone, or perhaps you're using S3 for static files for your website or as a content delivery network (CDN). But if you don't make the files public, your users will get an XML error message saying the file is unavailable.
30
+
31
+
1. Sign in to Amazon Web Services and go to your S3 Management Console.
32
+
33
+
2. Select the bucket from the left. At right, click the Properties button if it's not already expanded.
34
+
35
+
3. Go to the Permissions tab > Public Access Settings Tab
36
+
37
+
4. Click on Edit > Then
38
+
39
+
A) `Block new public ACLs and uploading public objects (Recommended)` - Make it false (i.e. uncheck it)
40
+
41
+
B) `Block new public bucket policies (Recommended)` - Make it false (i.e. uncheck it)
42
+
43
+
C) `Block public and cross-account access if bucket has public policies (Recommended)` - Make it false (i.e. uncheck it)
44
+
45
+
D) `Block public and cross-account access if bucket has public policies (Recommended)` - Make it false (i.e. uncheck it) - Without this last action, althouh I was able to upload BUT was NOT able to download.
46
+
47
+
So all the four options that was there (as on 24-Nov-2018) - I made all of them false.
48
+
49
+
#### I can test the upload API from Postman by selecting `http://localhost:3000/api/document/upload` and > POST > Body > form-data > under Key type "file" and under Value select file and choose a file.
50
+
51
+
And I will get back a 200 OK response of the below form-data
52
+
53
+
{
54
+
"data": {
55
+
"ETag": "a number",
56
+
"Location": "full link of the file",
57
+
"key": "original file name of the file that I uploaded",
58
+
"Key": "original file name of the file that I uploaded",
59
+
"Bucket": "my AWS s3 bucket name"
60
+
}
61
+
}
62
+
63
+
[Small note on .env file - When putting the value for "AWS_Uploaded_File_URL_LINK" - I have to include a forward slash ("/") after ]
0 commit comments