Storing files to a network folder using ASHX RRS feed

  • Question

  • User1794692932 posted

    I have a system where I am uploading files to a network folder from my website. I will have huge number of file uploads per day. Each user will have different types of files to upload. Now, we are in a doubt on the way we are storing our files in the Folder.

    We have two options

    1. Upload all files with a unique name to a folder named with UserID. So, finally my network folder will look like \\network-folder\UserID\{All my files of user..... n}
    2. Second option is upload files with a unique name to subfolder inside the folder named with UserID and have different folders inside the folder named with Categories and files inside it. eg: \\network-folder\UserID\{FOLDER's.... ..n}\{Files.. ..n}

    In the second case I will have multiple sub folders and the sub folders might again have up to 3 nested folders inside it and finally the file inside it.

    Which one of the above will be good for Performance in future when we are reading the file from these folders. As in both cases i will have all the information, path, filename in my DB and i will be calling the files directly from my application.

    My only concern is when the folder grow big, which approach will be faster and why I should go for it?

    Kindly help me in this. I do not have anyone who could help me with this situation.

    Monday, June 20, 2016 4:17 PM

All replies

  • User753101303 posted


    Or you could also group them by day for example rather than by user so that you keep a limited number of files in each folder (seems anyway you'll use already a unique name rather than the user defined name). Depends maybe on which kind of grouping you'll use to show all those files to users.

    Also if using SQL Server 2012 or later you could consider https://msdn.microsoft.com/en-us/library/ff929144(v=sql.110).aspx that basically offers the best of both worlds (files are stored in the db, but you can still access (and even add/modify them) through a network share if you want and you can save the db with or without those files). Even if not using this features it might be interesting to take some inspiration from that...

    Monday, June 20, 2016 4:45 PM