Reoss的.net的demo
[HttpPost]
public ActionResult Index(FormCollection fc)
{
var file = Request.Files[0];
file.SaveAs(@"c:\test.jpg");
try
{
ObjectMetadata meta = new ObjectMetadata();
//meta.ContentType = "image/jpeg";
meta.ContentLength = file.ContentLength;
meta.ContentType = file.ContentType;
OssClient client = new OssClient("《ID》", "《key》");
client.PutObject("《buket》", "test.jpg", file.InputStream, meta);
//uploadFile("ivantest1", "test.jpg", @"c:\test.jpg", "image/jpeg");
}
catch (Exception ex)
{
}
return null;
}