-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforce_upload_parade.py
More file actions
62 lines (50 loc) · 1.74 KB
/
force_upload_parade.py
File metadata and controls
62 lines (50 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python3
"""
Force upload just the Parade.htm file to fix the missing links
"""
import ftplib
import os
import time
# FTP Configuration
FTP_HOST = "ftp.michaelgiltz.com"
FTP_USER = "webmanager@michaelgiltz.com"
FTP_PASS = "ebullient-frozen-paw-vine12"
def main():
print("Force uploading Parade.htm...")
try:
# Connect to FTP
ftp = ftplib.FTP(FTP_HOST)
ftp.login(FTP_USER, FTP_PASS)
print("✓ Connected to FTP")
# Check current file size on server
try:
size = ftp.size('Parade.htm')
print(f"Current Parade.htm on server: {size} bytes")
except:
print("Could not get server file size")
# Check local file size
local_size = os.path.getsize('Parade.htm')
print(f"Local Parade.htm: {local_size} bytes")
# Upload with force overwrite
with open('Parade.htm', 'rb') as f:
ftp.storbinary('STOR Parade.htm', f)
print("✓ Uploaded Parade.htm")
# Verify new size
try:
new_size = ftp.size('Parade.htm')
print(f"New Parade.htm on server: {new_size} bytes")
if new_size == local_size:
print("✅ File sizes match - upload successful")
else:
print("⚠ File sizes don't match")
except:
print("Could not verify new file size")
ftp.quit()
print("\n" + "="*50)
print("Upload complete!")
print("Wait 1-2 minutes for changes to take effect")
print("Then check: http://michaelgiltz.com/Parade.htm")
except Exception as e:
print(f"❌ Error: {e}")
if __name__ == "__main__":
main()