mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 10:03:14 +08:00
Provide file size and an arbitrary name to the upload request
Apparently the Cloud will need to know the file size before it gets uploaded. It is used as a redundancy code to verify that it's not corrupt there. Perhaps they should ask for a CRC instead, being more reliable against an upload containing only null bytes or whatever, but that is not up to me to decide. Contributes to issue CURA-8609.
This commit is contained in:
parent
f0d69cbef2
commit
bdc269f8ab
@ -46,10 +46,11 @@ class UploadMaterialsJob(Job):
|
|||||||
self._archive_filename = archive_file.name
|
self._archive_filename = archive_file.name
|
||||||
|
|
||||||
self._material_sync.exportAll(QUrl.fromLocalFile(self._archive_filename), notify_progress = self.uploadProgressChanged)
|
self._material_sync.exportAll(QUrl.fromLocalFile(self._archive_filename), notify_progress = self.uploadProgressChanged)
|
||||||
|
file_size = os.path.getsize(self._archive_filename)
|
||||||
|
|
||||||
http = HttpRequestManager.getInstance()
|
http = HttpRequestManager.getInstance()
|
||||||
http.get(
|
http.get(
|
||||||
url = self.UPLOAD_REQUEST_URL,
|
url = self.UPLOAD_REQUEST_URL + f"?file_size={file_size}&file_name=cura.umm", # File name can be anything as long as it's .umm. It's not used by Cloud or firmware.
|
||||||
callback = self.onUploadRequestCompleted,
|
callback = self.onUploadRequestCompleted,
|
||||||
error_callback = self.onError,
|
error_callback = self.onError,
|
||||||
scope = self._scope
|
scope = self._scope
|
||||||
|
Loading…
x
Reference in New Issue
Block a user