You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Changed parameters for submit_file function. Eliminated the "body" parameter since it isn't needed, added "file_name" parameter to name the file, and added parameter "contents" to put the binary contents of the file.
3
+
- Added an option to the submit_file function to specify how many bytes from the beginning of a file to send to the detection service. Default is the first 32 MB, but is configurable to any positive integer.
By default, submit_file() will only send the first 32 MB (32,000,000 bytes) of a file, which is the API limit, but this can be configured by setting the "file_size_limit" option to any positive integer, where the unit is bytes. While you can send more than 32 MB, the API will only use the first 32 MB itself, so this option will save network bandwidth.
46
+
```
47
+
# Send the first 10 MB of the file
48
+
result = detection.submit_file(file_name="myfile.txt", contents=open("path/to/myfile.txt", "rb"), file_size_limit=10000000)
result = detection.submit_file(file_name="myfile.txt", contents=open("path/to/myfile.txt", "rb"))
30
+
```
31
+
32
+
By default, submit_file() will only send the first 32 MB (32,000,000 bytes) of a file, which is the API limit, but this can be configured by setting the "file_size_limit" option to any positive integer, where the unit is bytes. While you can send more than 32 MB, the API will only use the first 32 MB itself, so this option will save network bandwidth.
33
+
```
34
+
# Send the first 10 MB of the file
35
+
result = detection.submit_file(file_name="myfile.txt", contents=open("path/to/myfile.txt", "rb"), file_size_limit=10000000)
"""Allows you to submit a binary file object for malware analysis.
77
79
78
80
Keyword Arguments:
79
-
body {dict} -- The body of your http request. This is optional. (default: {None})
80
-
files {io.TextIOWrapper} -- The file you will be submitting for analysis. (default: {None})
81
+
file_name {string} -- The name of the file
82
+
contents {io.BufferedIOBase} -- The contents of the file in binary
83
+
file_size_limit {integer} -- The number of bytes to send to the detection service from the beginning of the file. Files that are smaller than the limit will be sent in their entirety. Files that are larger than this limit will only have the first 'n' bytes sent. Default is 32 MB (32,000,000 bytes).
0 commit comments