Initial commit (Clean history)

This commit is contained in:
anhduy-tech
2025-12-30 11:27:14 +07:00
commit ef48c93de0
19255 changed files with 3248867 additions and 0 deletions

27
upload.py Normal file
View File

@@ -0,0 +1,27 @@
import os, requests
file_path = 'datamodel.png'
file_name ='datamodel.png'
file_type = 'image/jpeg'
file_size = str(os.path.getsize(file_path)) # bắt buộc chuyển thành string
user = 1
url = 'https://api.y99.vn/upload/' # 🔁 thay bằng URL thực tế
#url = 'http://localhost:8000/upload/'
# Mở ảnh và gửi form
with open(file_path, 'rb') as f:
files = {
'file': (file_name, f, file_type)
}
data = {
'filename': file_name,
'name': file_name,
'type': 'image',
'size': file_size,
'user': user,
'convert': "0"
}
response = requests.post(url, files=files, data=data)
# In kết quả phản hồi từ server
print("Status code:", response.status_code)