i uploaded image via form /app_data/uploads/img-name.jpg
in view make:
<img src="~/app_data/uploads/@(model.photo).jpg">
but image not appear.
if try view via link (http://localhost:00000/app_data/uploads/img-name.jpg
) says:
server error in '/' application.
http error 403 - forbidden.
app_data protected folder hidden browsing. need make action on controller returns data.
public class downloadcontroller { public actionresult upload(string name) { return file(server.mappath("~/app_data/uploads/" + name + ".jpg"), "image/jpeg"); } }
Comments
Post a Comment