Wednesday, 15 February 2012

c# - How do I save image URL in database? -



c# - How do I save image URL in database? -

i have tried save image url in sql database path.compain() not work , file name saved in database instead of path. can help me?

if (request.files.count > 0) { httppostedfilebase file3 = request.files[2]; if (request.files.count > 2 && file3.contentlength > 0 && (file3.contenttype.toupper().contains("jpeg") || file3.contenttype.toupper().contains("png") || file3.contenttype.toupper().contains("gif"))) { string filename = path.combine(server.mappath("~/advertimages/cars/mercedes"), path.getfilename(file3.filename)); file1.saveas(filename); modelcar.image3url = filename; } }

you can create new fileinfo object filename

fileinfo fi = new fileinfo(filename);

and utilize fi.fullname();

c# asp.net iis

No comments:

Post a Comment