|
232 | 232 | "collapsed": false |
233 | 233 | }, |
234 | 234 | "id": "68d3439f0eda8352" |
| 235 | + }, |
| 236 | + { |
| 237 | + "cell_type": "markdown", |
| 238 | + "source": [ |
| 239 | + "### 7. Working with large files\n", |
| 240 | + "ReversingLabs SDK supports uploading large files to Spectra Detect. \n", |
| 241 | + "File upload methods of the `TitaniumScale` class offer an optional argument called `large_file` that can be set to `True` if you require uploading \n", |
| 242 | + "a file that exceeds the memory capabilities of your computer. \n", |
| 243 | + "\n", |
| 244 | + "To use this functionality, you first need to install the optional dependencies listed under the `largeFiles` keyword. To do so, install the RLSDK (or just add those dependencies) like this: \n", |
| 245 | + "\n", |
| 246 | + "`pip install reversinglabs-sdk-py3[largeFiles]` \n", |
| 247 | + "\n", |
| 248 | + "This will install the `requests-toolbelt` library which is needed for uploading large files. \n", |
| 249 | + "After you are done with that, you can call the upload methods with the mentioned `large_file` argument:" |
| 250 | + ], |
| 251 | + "metadata": { |
| 252 | + "collapsed": false |
| 253 | + }, |
| 254 | + "id": "721e1482ccf45e43" |
| 255 | + }, |
| 256 | + { |
| 257 | + "cell_type": "code", |
| 258 | + "execution_count": null, |
| 259 | + "outputs": [], |
| 260 | + "source": [ |
| 261 | + "response = tiscale_obj.upload_sample_from_path(\n", |
| 262 | + " file_path=\"/path/to/your/file.exe\",\n", |
| 263 | + " large_file=True\n", |
| 264 | + ")" |
| 265 | + ], |
| 266 | + "metadata": { |
| 267 | + "collapsed": false |
| 268 | + }, |
| 269 | + "id": "d5ee48dd153be667" |
| 270 | + }, |
| 271 | + { |
| 272 | + "cell_type": "markdown", |
| 273 | + "source": [ |
| 274 | + "If you set the `large_file` argument to `True` without installing the optional dependencies, you will receive the following exception:\n", |
| 275 | + "\n", |
| 276 | + "`To use large file upload, you need to run 'pip install reversinglabs-sdk-py3[largeFiles]' because additional dependencies are required.`" |
| 277 | + ], |
| 278 | + "metadata": { |
| 279 | + "collapsed": false |
| 280 | + }, |
| 281 | + "id": "2f2bf701572ce7" |
235 | 282 | } |
236 | 283 | ], |
237 | 284 | "metadata": { |
|
0 commit comments