0

I am building a dating site, the user have the option to upload 6 images.

my question is where to save them. I red about file system/data bases approach and didn't figured out yet which one to use, and this is the first time for me to accept files.

So where to save them? in the root application folder? in the app_data folder?

  • i red here about the same* questions but didn't find a conclusive answer.
Eran Meir
  • 133
  • 2
  • 12
  • possible duplicate of [Store pictures as files or in the database for a web app?](http://stackoverflow.com/questions/561447/store-pictures-as-files-or-in-the-database-for-a-web-app) – Shadow The GPT Wizard Apr 27 '14 at 11:42
  • Since you're building a dating site, it sounds like these images might get downloaded/viewed often, if that is the case, you might consider hosting the images off-site, as hosting them along with your web app might get expensive. You might want to look at Amazon S3 or Azure Storage. – Tobias Apr 27 '14 at 12:06
  • @Tobias for that site you are right. I have another project where the user need to upload word files.. where would you recommend to save these? – Eran Meir Apr 27 '14 at 13:48
  • @Shadow Wizard , I already red the solution in the link and it's not duplicated because I asked for an example to where to keep the files. and also an approach- save the file in the file system and the path in the database per user, right? – Eran Meir Apr 27 '14 at 13:59
  • File system and the path in database, yes. As Tobias correctly said if you expect lots of hits you better store the images on a different site, for example Stack Exchange is using imgur.com as its images host. If you don't expect many hits or don't care about bandwidth store in a different location on the server (**not under the root**), so that users won't be able to directly browse the images. – Shadow The GPT Wizard Apr 27 '14 at 14:16
  • @Shadow Wizard if not under the root, so where- what are the alternative ? – Eran Meir Apr 27 '14 at 14:37
  • @user2487126 `C:\UserImages` for example. Then have `.ashx` to read them when requested. – Shadow The GPT Wizard Apr 27 '14 at 14:42
  • @Shadow , you mean on the server- C:\UserImages , right? what about localhost? how can i direct to that folder? – Eran Meir Apr 27 '14 at 14:59
  • Yes on the web server. To show the images you'll have to create a web handler, good tutorial is available [here](http://www.dotnetperls.com/ashx). – Shadow The GPT Wizard Apr 27 '14 at 15:08

0 Answers0