cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
axelsena
Community Contributor

Course Migration via API

I'm trying to load up a zip file to a canvas course via a url, using php / curl and the API.  I keep getting error messages back, and I was wondering if anyone can give me some guidance on what i'm missing.  The file I'm trying to upload is on a public url, and is not password protected.

$cURL->post("/courses/42800/content_migrations",array(
                                                        "migration_type" => 'zip_file_importer',
                                                        "attachment" => array("url" => "https://path_to_d2lexport.zip"),
                                                        "pre_attachment" => ''
                                                        ));

I've tried going about it with trying to upload the file first via the api, but there it gives me back an error that the file is too large.

Any suggestions would be appreciated!

Labels (1)
4 Replies
stuart_ryan
Community Coach
Community Coach

Hi  @axelsena ,

May I ask how big the file is? Also prior to uploading, have you ensured the course file system quota is larger than your file import.

I would recommend setting the file system quota to 2.5x the size of the file upload, as it will need to upload, extract, and put the files in place.

Let me know how you go (if that is not the issue, we can dig deeper).

Hope that helps!
Stuart

axelsena
Community Contributor

The file I am uploading is about 200mb - and the canvas course quota is 1gb

Hi  @axelsena ,

Thanks for that, and just to make sure I am being thorough, can I assume this is a blank course? Would like to ensure that, even if the quota is 1Gb. there is not already more than 800Mb in use before attempting the upload.

Look forward to hearing from you.

Stuart

Hi  @axelsena ,

I thought I would check in and see how you were doing, would love to hear back from you on whether this was into a blank course or not.

Cheers,
Stuart