Create app
ng new ngx-input-file-s3-uploads
cd ngx-input-file-s3-uploads
ng add @angular/material
yarn add ngx-input-file aws-sdk
add to polyfills.ts
if (typeof (window as any).global === 'undefined') { (window as any).global = window; }
add to tsconfig.app.json
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": [
"node"
]
# Refer to app.modules.ts
const config: InputFileConfig = {
fileAccept: '*',
fileLimit: 1
};
imports: [
BrowserModule,
BrowserAnimationsModule,
FormsModule,
MatToolbarModule,
InputFileModule.forRoot(config),
],
Update your environment.ts file as follows:
export const environment = {
production: false,
accessKeyId: "YourAccessKeyId",
secretAccessKey: "YourSecretAccessKey",
region: "us-east-1",
bucketName: "YourBucketName",
baseFolder: "images/",
};