Teresa Alves
Teresa Alves

Reputation: 523

Save Images to folder located in wwwroot

I have a folder in wwwroot folder named Images. I want to save my images to that folder. Right now the images are being saved in the wwwroot folder (outside Images), and the name of the image saved starts with Images. Here is the code that I'm using:

  string filepath = Path.Combine(_caminho.WebRootPath, "Images" + name);

"name" ia a string that has the name of the image. Why is this happening?

Upvotes: 0

Views: 742

Answers (1)

Dylan Smyth
Dylan Smyth

Reputation: 162

It seems that you're concatenating the string "Images" to name. I would suggest that you do

(..."Images", name);

Upvotes: 1

Related Questions