Is there any way to display image in client browser without uploading it to server?

后端 未结 4 605
攒了一身酷
攒了一身酷 2021-01-24 01:57

I am writing a simple \"Book\" create page in ASP.NET MVC. User can create book by filling title,year etc.. and selecting a cover image. When user press \"Create\" button Form

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-24 02:27

    Due to security reasons, you will not be able to display the images to the users without uploading them to the server. Displaying images from file system is considered a security risk.

    EDIT: To remove the unused images, you can create a thread to run a cleanup routine to which will delete them from the upload directory regularly.

提交回复
热议问题