'Memory error while uploading large file using python
When i Upload file more than 3 gb it returns Memory error. How to upload this in chunk?
def anonfileupload(file):
upload_url = 'https://api.anonfiles.com/upload'
formdata = {
'file': open(file, 'rb'),
}
resp = requests.post(upload_url, files=formdata).json()
if resp["status"]:
resp_json = {
"status": resp['status'],
"url_short": resp["data"]["file"]["url"]["short"],
"url_full": resp["data"]["file"]["url"]["full"],
"metadata": resp["data"]["file"]["metadata"]
}
print(resp_json['url_short'])
elif resp["error"]:
print(resp["error"])
else:
print (resp["data"]["file"]["url"]["short"])
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
