Skip to content

Commit

Permalink
Fixed bug when uploading an encrypted file
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTiz authored and SteveMcGrath committed May 14, 2024
1 parent a0c581a commit a649644
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tenable/io/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ def upload(self, fobj: BinaryIO, encrypted: bool = False):
# We will attempt to discover the name of the file stored within the
# file object. If none exists however, we will generate a random
# uuid string to use instead.
kw = dict()
noEnc = ''
params = dict()
if encrypted:
noEnc = '?no_enc='+str(int(encrypted))
kw['files'] = {'Filedata': fobj}
params['no_enc'] = int(encrypted)
kw = {'files': {'Filedata': fobj}}

return self._api.post('file/upload'+noEnc, **kw).json()['fileuploaded']
return self._api.post('file/upload', **kw, params=params).json()['fileuploaded']

0 comments on commit a649644

Please sign in to comment.