0

I'm trying to create a upload center application using Asp.Net MVC 4. I want to have a url like this : http://site.com/user/{username}/{path} and path is like this/dir1/subdir2/file.txt and I return it(or edit it or etc)

but I don't know how can I allow to have / character in url? because Mvc throws a security exception. can anybody Help me?

The directories aren't physical. I keep all files in one directory and save their's properties in DataBase

ahmadali shafiee
  • 4,350
  • 12
  • 56
  • 91

1 Answers1

2

The feature you are looking for is called "wildcard routing" (see duplicate File path as MVC route argument for more info).

  "http://site.com/user/{username}/{*path}"
Community
  • 1
  • 1
Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179