2
I have an Asp . Net MVC project, with a form on View which sends files to the Controller.
In control I recover the files as follows:
var myFiles = Request.Files;
Not saving the file, just reading the content.
The question is, where are these files from Request.Files
? In memory or some temporary folder on the server?
Imagine the following scenario:
100 users sending at the same time 10 100MB files each, all this will be allocated in memory?
I believe this can greatly impair the performance of my server, am I right? Is there any way around the problem?
Limit upload?
– Jéf Bueno
Thank you @LINQ , but even so this would not limit the amount of users simultaneously sending a small amount of files. Still I would have a problem, but what has caused me doubt is where are those files obtained through the
Request.Files
, because maybe I could think a little better with the answer.– Jedaias Rodrigues
Well, chances are they’ll stay in the memory, along with all the other information about the request. Recording on disk to recover later seems more damaging than having it in memory to do whatever it takes. If you need many uploads and they are large files, you will need a server that can handle this. If you are afraid that someone will make a "joke" and end up disturbing the work of the server, you will need a way to block it. Anyway, I’m not sure about that and I can’t see right now, it’s more of a guess anyway.
– Jéf Bueno
Thanks again @LINQ , I also assume that the files are only in memory, but I would like to be more sure of that. I’m trying to find something in the documentation, but unsuccessful for now.
– Jedaias Rodrigues