1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| static function OnDone(oSession: Session) { var fileName=""; var fileIndex = oSession.RequestHeaders.RequestPath.LastIndexOf ("/"); if (fileIndex > 0) { fileName = oSession.RequestHeaders.RequestPath.Substring (fileIndex+1); } if (String.IsNullOrEmpty(fileName)) { fileName = Guid.NewGuid().ToString(); } var saveDir="H:\\test\\"; if (!System.IO.Directory.Exists(saveDir)) { System.IO.Directory.CreateDirectory(saveDir); } oSession.SaveResponseBody(saveDir + fileName); }
|