I am trying to reproduce the tutorial for Autodesk OSS, uploading a file to then convert it to an SVF. (https://aps.autodesk.com/en/docs/model-derivative/v2/tutorials/prep-file4viewer/task2-upload_source_file_to_oss/)
At the step where I upload the file, I use PUT with the previously retrieved URL to upload the file. However, the call returns an error "The specified methos is not allowed against this resource."
What am I doing wrong?
The file is a valid Revit about 4Mb in size. The call is in a windows .bat file like this (amazon secrets excluded):
set UPLOAD_URL=https://com-autodesk-oss-direct-upload.s3-accelerate.amazonaws.com/22/96/05/91/bucket/mybuckrlb1/signed-url-uploads/22960591-f887-4bd6-8b30-5f49c938f6cf?uploadId=sIQeHd.k4OGedrXdBfUv0aRX4STymgN_VL_ax1O0OSwtn3xIEvoKEDz1uH2KpMjx45dNZtFW9ogL295m1DK_meLVaH8YzFXx0DZ0CmWYBybvRoB3zJlAShxZKqitg8dW9G0M5ddm7_n0eaa23tsoSg--&partNumber=1&X-Amz-Security-Token=[token]&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230807T065756Z&X-Amz-SignedHeaders=host&X-Amz-Expires=599&X-Amz-Credential=[credentials]%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=[signature here]
set FILE_PATH=roofsamplefile.rvt
curl -v -X PUT ^
%UPLOAD_URL% ^
-H "Content-Type: application/octet-stream" ^
--data-binary "@%FILE_PATH%"
The response is this:
<Error><Code>MethodNotAllowed</Code><Message>The specified method is not allowed against this resource.</Message><Method>PUT</Method><ResourceType>UPLOAD</ResourceType><RequestId>90P68QHV7EVGPSSE</RequestId><HostId>CBjCUDY7fHlbJz0YSHkinHu6xIg7oSsL7a8DZrX7F6wd13Hp5qQZ3DBeCSaODMfKoHSympbe9o0=</HostId></Error>
I've tried to do a POST call instead - it returns a different error, MaxMessageLengthExceeded with MaxMessageLengthBytes=2097152.
To note: I have also tried the older way of uploading the file: https://developer.api.autodesk.com/oss/v2/signedresources via a call to https://developer.api.autodesk.com/oss/v2/buckets/[bucket]/objects/[file key]/signed . This upload is successful, so the file, the network, the access token and everything else is fine. Unfortunately, the file uploaded in this way is not visible to the converting job, so I need to make the "recommended" method work.
For completeness - this is the call used to get the upload URL:
curl -X GET ^
"%API_BUCKETS%/%BUCKET_NAME%/objects/%FILE_PATH%/signeds3upload?minutesExpiration=%LIFESPAN_MINUTES%" ^
-H "Authorization: Bearer %AUTH_TOKEN%" ^
-o "output.json"
I also tried to finalize the file without uploading anything to amazon, just to do a POST call to signed3supload. The response was "The requested resource does not exist".