dynamic upload&remove unpack.php
This commit is contained in:
parent
9bc77e0c8b
commit
482ac333d2
@ -26,14 +26,19 @@ def upload_by_ftps(archive):
|
||||
if ftp.pwd() == '/':
|
||||
with open(archive, 'rb') as f:
|
||||
ftp.storbinary('STOR {0}'.format(archive), f)
|
||||
os.remove(archive)
|
||||
|
||||
os.remove(archive)
|
||||
with open('unpack.php', 'rb') as f:
|
||||
ftp.storbinary('STOR unpack.php', f)
|
||||
|
||||
|
||||
def get_unpack(archive):
|
||||
f = urllib.request.urlopen('https://blog.iiiypuk.me/unpack.php?f={0}'.format(archive))
|
||||
f.read()
|
||||
|
||||
ftp = ftplib.FTP_TLS(host=HOST, user=USER, passwd=PASSWORD)
|
||||
ftp.delete('unpack.php')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
os.system('rm -rf ./public/ &> /dev/null') # FIXIT
|
||||
|
Loading…
Reference in New Issue
Block a user