AnsweredAssumed Answered

File Upload Issue - Uploading via URL  

Question asked by Premchanth GnanaKannan on Aug 31, 2018

Facing issue in file upload using Uploading via URL approach:

 

I am following the below steps:

 

Step 1: Initialize Post request to https://canvas.instructure.com/api/v1/courses/XXXXXXX/files

Request Body:

url: "my_file_path"  // This file refers to file in cloud storage which is public

name: "my_file_name"

content_type:video/mp4

parent_folder_path: ""

size: 5464657

 

Response from canvas ( 200 OK)

{
"file_param": null,
"progress": {
   "id": 2657345,
   "context_id": 21696702,
   "context_type": "User",
   "user_id": 21696702,
   "tag": "upload_via_url",
   "completion": null,
   "workflow_state": "running",
   "created_at": "2018-08-31T11:45:54Z",
   "updated_at": "2018-08-31T11:45:54Z",
   "message": null,
   "url": "https://canvas.instructure.com/api/v1/progress/XXXXXXX"
},
"upload_url": "https://inst-fs-iad-prod.inscloudgate.net/files?token=token edited",
"upload_params": {
   "filename": "my_file_name",
   "content_type": "video/mp4",
   "target_url": "my_file_path"
}
}

 

Step 2: If I check the upload status using the URL from the previous API response https://canvas.instructure.com/api/v1/progress/XXXXXXX, the workflow_state is always running

 

File is not uploaded to canvas.

 

I am new to canvas. Please Help me.

 

Outcomes