{"record":{"id":"d47320928c3a8dcd","repo":"instructure/canvas-lms","slug":"invalid-upload-type","errorCode":null,"errorMessage":"Invalid upload type","messagePattern":"Invalid upload type","errorType":"exception","errorClass":"OtherError","httpStatus":null,"severity":"error","filePath":"gems/plugins/respondus_soap_endpoint/lib/respondus_soap_endpoint/urn_RespondusAPIServant.rb","lineNumber":550,"sourceCode":"    end\n\n    ASSET_TYPES = {\n      \"quiz\" => \"Quizzes::Quiz\",\n      \"qdb\" => \"AssessmentQuestionBank\",\n    }.freeze\n\n    ATTACHMENT_FOLDER_NAME = \"imported qti files\"\n\n    def do_import(item, itemType, uploadType, _fileName, fileData)\n      if fileData == \"\\x0\" && session[\"pending_migration_id\"]\n        return poll_for_completion\n      end\n\n      unless %w[quiz qdb].include?(itemType)\n        raise OtherError, \"Invalid item type\"\n      end\n      if uploadType != \"zipPackage\"\n        raise OtherError, \"Invalid upload type\"\n      end\n\n      selection_state = session[\"selection_state\"] || []\n      course = Course.where(id: selection_state.first).first\n      raise(OtherError, \"Item type incompatible with selection state\") unless course\n\n      # Make sure that the image import folder is hidden by default\n      Folder.assert_path(ATTACHMENT_FOLDER_NAME, course) do |folder|\n        folder.hidden = true\n      end\n\n      settings = {\n        migration_type: \"qti_converter\",\n        apply_respondus_settings_file: (itemType != \"qdb\"),\n        skip_import_notification: true,\n        files_import_allow_rename: true,\n        files_import_root_path: ATTACHMENT_FOLDER_NAME,\n        flavor: Qti::Flavors::RESPONDUS","sourceCodeStart":532,"sourceCodeEnd":568,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/gems/plugins/respondus_soap_endpoint/lib/respondus_soap_endpoint/urn_RespondusAPIServant.rb#L532-L568","documentation":"After validating the item type, do_import checks that uploadType is exactly \"zipPackage\". The Respondus SOAP import protocol only supports zipped IMS/QTI packages; any other upload format is rejected with OtherError.","triggerScenarios":"Calling publishServerItem/replaceServerItem with uploadType set to anything other than \"zipPackage\" (e.g. \"file\", \"qtiPackage\", wrong casing like \"ZipPackage\").","commonSituations":"Client configured for a non-Canvas server type that allows other upload formats; hand-rolled SOAP clients passing raw XML or unzipped QTI; version mismatch between client and Canvas plugin expectations.","solutions":["Send uploadType as exactly \"zipPackage\" (case-sensitive)","Zip the QTI/IMS package before uploading and confirm the client sends it as a zip package","Check the Respondus client server-type profile is set to Canvas"],"exampleFix":"// before\nclient.publish(\"quiz\", xmlData, \"qtiPackage\")\n// after\nclient.publish(\"quiz\", zipData, \"zipPackage\")","handlingStrategy":"validation","validationCode":"if (uploadType !== \"zipPackage\") throw new Error(\"uploadType must be exactly 'zipPackage'\");","typeGuard":null,"tryCatchPattern":"begin\n  servant.publishServerItem(session, itemType, uploadType, ...)\nrescue RespondusApi::OtherError\n  zip the package and resend\nend","preventionTips":["Zip QTI/IMS content before upload","Use case-sensitive string literal 'zipPackage'","Configure the client for the Canvas server profile"],"tags":["soap","respondus","invalid-argument"],"backgroundTag":"invalid-argument-value","analyzedSha":"1c9f0bb8013ed69c4f2efe11fd483025469b7e6c","analyzedAt":"2026-09-15T20:33:18.891Z","contentChangedAt":"2026-09-15T20:33:18.891Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}