Don't print an error message for empty courses
[nci.git] / nci-put-file.1
blobcdc96c601f93ea87a2baa216b86e42fc590af7a0
1 .Dd 2019-05-27
2 .Dt NCI-PUT FILE 1
3 .Os
4 .Sh NAME
5 .Nm nci-put-file
6 .Nd Add or overwrite a course file in a Canvas installation
7 .Sh SYNOPSIS
8 .Nm
9 .Fl c
10 .Ar course-id
11 .Fl n
12 .Ar filename
13 .Fl p
14 .Ar filepath
15 .Sh DESCRIPTION
16 .Nm
17 connects to a Canvas installation as described at
18 .Xr nci 1
19 and uploads
20 .Ar filepath
21 to the course file
22 .Ar filename .
23 .Pp
24 This program always uses the following options for the file upload:
25 .Pp
26 .Bl -bullet -compact
27 .It
28 .Em display_name
29 is the final part
30 .Pq past any /
32 .Ar filename ,
33 .It
34 .Em content-type
35 is automatic
36 .Po
37 Canvas will guess it based on
38 .Ar filename
39 .Pc ,
40 .It
41 the file is not
42 .Em locked
44 .Em hidden ,
45 .It
46 the file will
47 .Em overwrite
48 any other file with the same name.
49 .El
50 .Sh OPTIONS
51 .Bl -tag -width Ds
52 .It Fl c
53 The
54 .Ar course-id ,
55 as returned by
56 .Xr nci-list-courses 1 .
57 .It Fl n
58 Set the name of the new file. This should include any folder heirarchy,
59 and should not begin with a /. Canvas is expecting an arbitrary UTF-8
60 string.
61 .It Fl p
62 The path for the file to upload.
63 .El
64 .Sh EXAMPLES
65 .Dl % nci-put-file -c 1187637 -p /home/jsmith/teaching/2099/syllabus.pdf -n syllabus.pdf
66 .Dl % nci-put-file -c 1187637 -p /tmp/ex1.pdf -n Qo Practice Exams/Midterm #1/2098_midterm_1.pdf Qc
67 .Sh SEE ALSO
68 .Xr nci 1
69 .Xr nci-list-files 1
70 .Sh AUTHORS
71 .An S. Gilles Aq Mt sgilles@math.umd.edu