public void UploadStream(string tmp_path, string identifier) { try { using (var fs = new FileStream(tmp_path, FileMode.Open)) { var gridFsInfo = gridFS.Upload(fs, identifier); } } catch (MongoConnectionException e) { DriverException exception = new DriverException(e.Message, e); exception.ExplainProblem(); } }
public void UploadThumbnail(string tmp_path, string identifier) { var tmp_img_path = identifier + "-thumbnail"; try { NReco.VideoConverter.FFMpegConverter converter = new NReco.VideoConverter.FFMpegConverter(); converter.GetVideoThumbnail(tmp_path, tmp_img_path); using (var fs = new FileStream(tmp_img_path, FileMode.Open)) { var gridFsInfo = gridFS.Upload(fs, tmp_img_path); } File.Delete(tmp_img_path); } catch (MongoConnectionException e) { DriverException exception = new DriverException(e.Message, e); exception.ExplainProblem(); } }