Skip to content

Commit e371a65

Browse files
committed
reset file read after probing file type
1 parent 265b69b commit e371a65

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/datasets.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,10 @@ fn upload_from_file(
178178
};
179179

180180
let ft = detect_from_path(path).unwrap_or_else(|| {
181-
use std::io::Read;
181+
use std::io::{Read, Seek};
182182
let mut probe = [0u8; 512];
183183
let n = f.read(&mut probe).unwrap_or(0);
184+
let _ = f.seek(std::io::SeekFrom::Start(0));
184185
detect_from_bytes(&probe[..n])
185186
});
186187

0 commit comments

Comments
 (0)