Hello. I managed to connect to my ftp and create a new directory with ftp.mkd(folderName). However, I want to create a txt file within this folder and write in it with another string. In quick steps:
- Create a blank .txt file (in a FTP folder, that's the important part)
- Add text to the .txt file.
How it gets done?
MAYBE, I fixed by creating a local file, there we go:
article = 'This is my whole article.'
open('article.txt', 'w').write(article)
ftp.storlines('STOR ' + path/to/folder/article.txt, open('article.txt','r'))
os.remove('article.txt')
I believe this generates a local text file in my device, so I thought about using os.remove to delete it afterwards, does it work as I could expect?