Upload error: File extension and size

hello.
I am developing solutions to provide convenience related to clinical trials in Korea.
Data is exchanged using a parser server.
At this time, there are some problems with sending and receiving files.
My parse server settings are as follows.

databaseURI: β€˜β€™,
cloud: β€˜β€™,
appId: β€˜β€™,
masterKey: β€˜β€™,
restAPIKey: β€˜β€™,
javascriptKey:’’,
serverURL: β€˜β€™,
maxUploadSize: β€œ200mb”,
fileUpload: {
enableForPublic: false,
enableForAnonymousUser: false,
enableForAuthenticatedUser: true,
},
filesAdapter: fsAdapter

For security reasons, the file is stored locally.

First, there is a file format issue.
Due to the nature of Korea, it is necessary to be able to save and download Hancom Office files.
However, there is an extension problem when saving Hancom Office files.
image
How to solve this?

The second is the file size issue.
After checking, files larger than 1 or 2 MB cannot be uploaded.
I searched the community and set the settings as below, but it did not resolve the issue.

const app = express();
app.use(bodyParser.json({limit: β€˜200mb’}));
app.use(bodyParser.urlencoded({limit: β€˜200mb’, extended: true}));

How to solve this?

will wait for the reply.
Thanks.

This is where detect and observe file extension in parse server :

./Controllers/FilesController.js


filename = filename + '.' + _mime.default.getExtension(contentType);

you may have trouble with this part. Review here.

And if your problem layer in saving to db, you can change upload size configuration this file:

GridFSBucketAdapter(for Mongo)

Thank you very much for your reply.
As for the file extension issue, your words were a hint.
So I solved it by defining fileExtensions in the fileupload option.
thank you

How can I solve the file size problem?
I think the problem is that a Request Entity Too Large error.
When a certain capacity is exceeded, the request method seems to change.

Did you try on locally? We need to understand it is related to what was that.

ah! It is not a local environment.
We are building and testing a parse server in AWS EC2.
Is there anything I need to configure additionally if I do it on EC2 instead of locally?

I’ve used Parse Server on AWS-based infrastructure before and haven’t encountered any like this issues.