-2

Out of these following options, what would you guys recommend as a best practice or approach? I have a website that has a ton of pdf and word files that any one can click to download. What is the best way to serve these files to users?

  1. Create a virtual directory that points to a UNC path where the files are?
  2. Create a virtual directory that points to a physical path on the same server?
  3. Host the files on a third-party storage system?
  4. Any other ideas?

I just don't want the files mixed in with the website code files. They end up in source control and publishing takes awhile due to the file size, and it is hard for non-tech people to update the documents. They always call up IT to do it for them.

  • 1
    I would set up an S3 bucket and let your users manage that with a tool like CloudBerry Explorer. End users can link directly to and download from the S3 bucket. – Travis Stoll Aug 27 '14 at 15:49
  • 5
    seems pretty subjective. any of the solutions you mentioned seem fine. what's "best" will depend on a variety of factors that make this an unanswerable question as written. – user16081-JoeT Aug 27 '14 at 16:10
4

In general, it's not a good idea to mix user data with application code. You should maintain these separately, as code lives better in a repo, while data lives in a DB or a "raw" storage system - very different ways of storing information.

When you say "a ton" of documents, what does that mean? If you're looking at 100s of GBs in thousands of files, then a managed solution such as S3 will solve a lot of problems for you: - consistent download rates - redundant storage, no data loss - no need to worry about backups

On S3, files can have public links, so all you need to do is upload, and then maintain a list of the links on your website.

On the other hand, if you just have a few GBs, and update often, it might not be worth the trouble of setting up S3 - mount a "data" dir from somewhere on your disk, and point your application to it.

If you do choose S3: if you need custom design or a custom workflow in your site, you will need to change your application so it can talk to S3. S3 is not a file system - it speaks HTTP - so you will need custom coding for this to be as flexible as it can be.

Not the answer you're looking for? Browse other questions tagged or ask your own question.