Hi,
I'm implementing file upload via the API and failing. The error is HTTP 501, with the message "upload failed", which isn't too enlightening sadly.
I can reproduce this with curl, so probably I'm doing misunderstanding how I should be making the call:
curl -X POST -H "Content-type: multipart/form-data" --form "content=iso" --form "filename=@my-disc.iso" -H 'Cookie: PVEAuthCookie=<cookie>' -H 'Csrfpreventiontoken: <token>' -k https://<my-proxmox>/api2/json/nodes/<node>/storage/local/upload
After some digging into the source and adding log output, the problem seems to be that $rstate->{md5sum} isn't initialized here: https://git.proxmox.com/?p=pve-http...d629fe5e565d197221;hb=refs/heads/master#l1090
From my reading of the code it isn't clear to me how it ever would be set, but I'm not very fluent in perl, so perhaps there is something I'm missing.
I'm running PVE 5.4, if relevant, but the code seems to be the same in PVE 6.0.
Happy for help understanding where I'm going wrong!
I'm implementing file upload via the API and failing. The error is HTTP 501, with the message "upload failed", which isn't too enlightening sadly.
I can reproduce this with curl, so probably I'm doing misunderstanding how I should be making the call:
curl -X POST -H "Content-type: multipart/form-data" --form "content=iso" --form "filename=@my-disc.iso" -H 'Cookie: PVEAuthCookie=<cookie>' -H 'Csrfpreventiontoken: <token>' -k https://<my-proxmox>/api2/json/nodes/<node>/storage/local/upload
After some digging into the source and adding log output, the problem seems to be that $rstate->{md5sum} isn't initialized here: https://git.proxmox.com/?p=pve-http...d629fe5e565d197221;hb=refs/heads/master#l1090
From my reading of the code it isn't clear to me how it ever would be set, but I'm not very fluent in perl, so perhaps there is something I'm missing.
I'm running PVE 5.4, if relevant, but the code seems to be the same in PVE 6.0.
Happy for help understanding where I'm going wrong!