Python Forum
Uploading files to NAS from Raspberry PI using python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Uploading files to NAS from Raspberry PI using python
Hello. We have NAS drive connected to our network.IT administrator allocated me 4GB of space for testing and I have been given ID,password, and the IP address to access the NAS. By typing given IP address on the browser, I can access my NAS and upload files there.

[Image: 0ygr3Zr]

However, I need to be able to upload images to NAS drive from python script. I have been looking at SMBConnection library and trying the following code:
from smb.SMBConnection import SMBConnection

conn = SMBConnection('given_ID','given_pass','????','????')

results = conn.listPath('File Station','Raspberry_Pi')

for x in results:
Note that for 3rd and 4th argument I have put ???? since I cannot figure out what do I need to pass there. Unfortunately, reading documentation does make it more clear:

I think that could be an issue since I am not passing these two arguments correctly. Could someone give me a hint and let me know what am I supposed to pass there?

Whatever code I put below conn.connect line, The output is the same:
[Image: h1Byq67]

Possibly Related Threads…
Thread Author Replies Views Last Post
  Coding for Python and Raspberry pi beast 3 559 Sep-21-2021, 09:56 PM
Last Post: beast
  python 3 raspberry pi 4 dual control motor programming problem yome 0 854 Mar-21-2021, 05:17 PM
Last Post: yome
  Embedded python fails to compile on Raspberry Pi tryfon 2 1,285 Dec-22-2020, 02:06 PM
Last Post: tryfon
  Uploading a file to s3 pisike 2 814 Nov-30-2020, 04:43 PM
Last Post: bowlofred
  Port my python program to Raspberry pi seamlessly Hassibayub 1 944 Jun-29-2020, 12:58 PM
Last Post: snippsat
  Project files, Python files Heyjoe 4 1,269 Jun-27-2020, 07:30 PM
Last Post: Heyjoe
  Raspberry Pi Python Rest Post madaxe 0 764 Nov-01-2019, 07:30 PM
Last Post: madaxe
  A question about python in Raspberry Psycopast 3 1,270 Aug-14-2019, 06:36 PM
Last Post: buran
  Raspberry - Python 3.7 - Installation trouble madjo1983 2 2,014 Jul-07-2019, 02:06 AM
Last Post: DeaD_EyE
  Install Python on Raspberry Pi 3 B+ loren41 4 2,855 May-03-2019, 03:13 PM
Last Post: loren41

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020