how can i make an uploading image page via razor syntax (CSHTML) to simply upload file to /image root with increasing name like imgxxxyyy.jpg when the img part is fixed and xxx is the id of the inserting/updating product and yyy is the increasing number of image of that product and store the path to the imagpath column in my table ?
more i think about it and i research about it i get more confused …. please help me in this case .
It would be easier if you used Guids for filenames. So you could define a view model:
a view containing a form where the user will be able to select a file to upload:
and finally a controller to show the form and process the upload: