fixed uploading html/pngs in website func
This commit is contained in:
parent
aa2b83617c
commit
fecace66ed
1 changed files with 3 additions and 13 deletions
|
|
@ -1065,24 +1065,14 @@ async def website(ctx):
|
||||||
await client.connect(ftp_server)
|
await client.connect(ftp_server)
|
||||||
await client.login(ftp_username, ftp_password)
|
await client.login(ftp_username, ftp_password)
|
||||||
await client.change_directory(server_folder)'''
|
await client.change_directory(server_folder)'''
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for filename in os.listdir(local_folder):
|
for filename in os.listdir(local_folder):
|
||||||
if ".png" in filename:
|
if ".png" in filename:
|
||||||
#await client.upload(local_folder + filename, filename, write_into=True)
|
upload_sftp(filename, (os.getenv('ftp_public_html') + 'ai-webpage/'), filename)
|
||||||
async with asyncssh.connect(ftp_server, username=ftp_username, password=ftp_password) as conn:
|
|
||||||
async with conn.start_sftp_client() as sftp:
|
|
||||||
remotepath = server_folder + filename
|
|
||||||
await sftp.put(filename, remotepath=remotepath)
|
|
||||||
#explicitly upload html files last!
|
#explicitly upload html files last!
|
||||||
for filename in os.listdir(local_folder):
|
for filename in os.listdir(local_folder):
|
||||||
if ".html" in filename:
|
if ".html" in filename:
|
||||||
#await client.upload(local_folder + filename, filename, write_into=True)
|
upload_sftp(filename, (os.getenv('ftp_public_html') + 'ai-webpage/'), filename)
|
||||||
async with asyncssh.connect(ftp_server, username=ftp_username, password=ftp_password) as conn:
|
|
||||||
async with conn.start_sftp_client() as sftp:
|
|
||||||
remotepath = server_folder + filename
|
|
||||||
await sftp.put(filename, remotepath=remotepath)
|
|
||||||
|
|
||||||
|
|
||||||
server_folder = ftp_public_html + 'ai-webpage/'
|
server_folder = ftp_public_html + 'ai-webpage/'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue