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
#1
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','????','????')
conn.connect('192.168.50.230')

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

for x in results:
   print(x.filename)
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:
https://pysmb.readthedocs.io/en/latest/a...ction.html


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]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  uploading files from a ubuntu local directory to Minio storage container dchilambo 0 401 Dec-22-2023, 07:17 AM
Last Post: dchilambo
  Video recording with Raspberry Pi - What´s wrong with my python code? Montezuma1502 3 1,180 Feb-24-2023, 06:14 PM
Last Post: deanhystad
  Coding for Python and Raspberry pi beast 3 39,529 Sep-21-2021, 09:56 PM
Last Post: beast
  python 3 raspberry pi 4 dual control motor programming problem yome 0 1,940 Mar-21-2021, 05:17 PM
Last Post: yome
  Embedded python fails to compile on Raspberry Pi tryfon 2 3,401 Dec-22-2020, 02:06 PM
Last Post: tryfon
  Uploading a file to s3 pisike 2 1,730 Nov-30-2020, 04:43 PM
Last Post: bowlofred
  Port my python program to Raspberry pi seamlessly Hassibayub 1 1,898 Jun-29-2020, 12:58 PM
Last Post: snippsat
  Raspberry Pi Python Rest Post madaxe 0 1,330 Nov-01-2019, 07:30 PM
Last Post: madaxe
  A question about python in Raspberry Psycopast 3 2,309 Aug-14-2019, 06:36 PM
Last Post: buran
  Raspberry - Python 3.7 - Installation trouble madjo1983 2 3,030 Jul-07-2019, 02:06 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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