I am using ArcGIS API for Python to upload content to Portal using the gis.content.add and then publish methodology (this process needs to be automated). It works great with small/regular sized shapefiles, but when I attempt to publish larger shapefiles (~1GB), I get the following error message during the gis.content.add part of the script:

This method works well in my development environment, where my data store is on my local hard-drive, but when I attempt this in the testing environment the data store is an Amazon Web Service (AWS) cloud. Does anyone know why I am getting this error? What can I do to fix it?
As of now, the only thing I can think of is that the data transfer is timing out. If that is the case there must be a workaround.
Here is the part of the script where it is failing:
#add content named "file"
shp = gis.content.add(
item_properties = {
"type": "Shapefile",
"title": filename,
"description": "Just a random Study Area",
"tags": "Clip Area, Study Area",
},
data = file,
)