where is the best place to save images from users upload

前端 未结 5 446
挽巷
挽巷 2020-11-27 11:37

I have a website that shows galleries. Users can upload their own content from the web (by entering a URL) or by uploading a picture from their computer.

I am storin

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-27 12:34

    One way is to store the image in a database table with a varbinary field.

    Another way would be to store the image in the App_Data folder, and create a subfolder for each user (~/App_Data/[userid]/myImage.png).

    For both approaches you'd need to create a separate action method that makes it possible to access the images.

提交回复
热议问题