Python Copy a Picture between a Raspberry Pi and a Windows File server

Viewed 11

I want to copy the image Test.png (→ path: /home/testuser/Desktop/Picture.png) to my file server (→ Path: \Server/ImagesBackup/). For this, I tried the following:

pathpicture=r"\\Server/backup/Bild1.png"
path= "/home/testuser/Pictures/Picture.png"
smbclient.copyfile(path,pathpicture, username=username, password=password)

Unfortunately, I only get the following error message:

ValueError: src must be an absolute path to where the file should be copied from.

Does anyone have an idea?

1 Answers

Use backslashes in windows. It is also asking for an absolute path

That complies with this> C:\SomeDirectory\Image.jpg

Related