我需要能夠上傳文件上傳中的KML文件,使用XSLT將其轉換爲GML,然後將其保存到我的SQL 2008數據庫中。我不知道該怎麼做。任何幫助表示讚賞。如何在文件上傳中使用XSLT ASP.Net MVC
這裏是我的代碼至今:
public ActionResult Create(GeoRegion georegion, HttpPostedFileBase Polygon)
{
if (ModelState.IsValid)
{
if (Polygon.ContentLength > 0)
{
var fileName = Path.GetFileName(Polygon.FileName);
var path = Path.Combine(Server.MapPath("~/App_Data/uploads"), fileName);
Polygon.SaveAs(path);
}
db.GeoRegions.Add(georegion);
db.SaveChanges();
return RedirectToAction("Index");
}
return View(georegion);
}
如果您還沒有這樣做的話,我建議你閱讀[文章](HTTP:// spanring .eu/blog/2005/12/11/kml2gml /)由Christian Spanring提供。 – kush