jborean93 / smbprotocol

Python SMBv2 and v3 Client
MIT License
318 stars 73 forks source link

send\upload #160

Closed idanless closed 2 years ago

idanless commented 2 years ago

Hi

not sure im understnd how send\upload file to the server

all the time got "raise ValueError("src must be an absolute path to where the file should be copied from.") ValueError: src must be an absolute path to where the file should be copied from."

jborean93 commented 2 years ago

You will want to look at the smbclient.shutil package. There is the copy, copy2, and copyfile functions which reflect the same behaviour in the builtin shutil package https://docs.python.org/3/library/shutil.html. The error you are getting is from smbclient.copyfile which is designed only for copying files on the fileshare itself. The functions in smbclient.shutil are designed to work across an SMB share and local paths.

idanless commented 2 years ago

many thanks got it! works!!