Click here to Skip to main content
15,883,851 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating a .NetCore app to allow users of my network to upload file(s)

What I have tried:

A. Use a WebAPI MVC Controller project, create an Upload Post action method.
B. Provide this Web API to the end users.
C. For the client side, I plan to use MVC FileUpload control with multi files option set to True.

I need your inputs for these questions:

1. How will I limit size of the uploaded files to a certain file size ?
2. What is best plan for storing these files and making it scalable for a large amount of files?
3. These file(s) might contain personal data – how would I secure such data?
Possibly, I can used some encryption key, but how would I manage this key.

Awaiting your valuable advice.
Posted
Updated 12-Jul-21 1:37am

1 solution

1) You have to establish a maximum file size, and process each file one at a time. You should be able to get the size of the uploaded file somehow before you start transferring data. If the file size is larger than the limit, reject the file and present an error. Since you're allowing multiple files to be uploaded at once, you might also want to consider limiting how many files the user can upload at one time, or even the total number of files the user can upload.

2) I'm assuming your users will need accounts to upload, so storing the files in user-specific folders is probably the best way.

3) You could compress the files with a password. Maybe use the user's account password as the key to their files. That way they can download them again and uncompress them with their account password.

Please don't ask for specific code because I'm not prepared (or willing) to do that.
 
Share this answer
 
v2
Comments
Member 15244870 12-Jul-21 7:40am    
Thanks, for quick replies. Can I not use encryption at SQL end for No.3?
#realJSOP 12-Jul-21 10:22am    
I suppose so, but you never once mentioned SQL or a database in your question. We can't read your mind.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900