Asp.net mvc 3: the best way to control a model with an image

I am trying to find the best way to manage the model accordingly.

I do not know whether it is better to save the image in the data warehouse

class MyModel {
  ...
  public byte[] ImageData { get; set; }
  ...
}

or save the url and upload the image to the file system

class MyModel {
  ...
  public string ImageUrl { get; set; }
  ...
}

Essentially, I want to control the image when I create or edit a model record.

I do not want the dedicated model / view / controller to load / save the image on the server. I want to control an image associated with a specific entity in db.

Regards, Giacomo

+5
source share
1 answer

, . - , URL- , / .

URL- , .

(, ), ImageData, ...

+1

All Articles