Skip to main content
All CollectionsOnline IDEUsing the CodeHS IDE
Uploading a File to Your Program
Uploading a File to Your Program

Upload images, sounds, and other files to use in CodeHS programs

Zach Galant avatar
Written by Zach Galant
Updated over a month ago
Banner: This is a Free feature.

Students can upload images and other files from their computers to add to their programs in the Code Editor. Uploading a .zip file will unzip and add all files to the program. Note: the file size limit is roughly 3 megabytes.

Uploading an Image File

  1. From the Code Editor, click More > Upload.

  2. Browse for the file you would like to upload > Open

  3. Copy and paste the URL to use in your program

Gif showing how to upload image from More > Upload tab.

Accepted Image types:

  • BMP (.bmp)

  • GIF (.gif)

  • JPG (.jpg)

  • JPEG (.jpeg)

  • PNG (.png)

  • SVG (.svg)

  • WEBP (.webp)

Uploading an Audio File

These file types files may also be added and used in programs in the Code Editor.

Accepted Audio types:

  • MP3 (.mp3)

  • MP4 (.mp4)

  • MID or MIDI (.mid or .midi)

  • OGG (.ogg)

  • WEBM (.webm)

  • WAV (.wav)

Uploading a Font File

Students can upload custom fonts from their computers to add to their CSS files within the CodeHS Code Editor.

To upload a custom font to your program:

  1. Click "New+", located on the left side of the IDE

  2. Select Upload from the drop-down menu > click Browse

  3. Locate your font file on your computer

  4. Click Open to upload your file to your project directory

GIF demonstrating how to upload a font file to your program

To use a custom font in your program:

Students will want to use the @font-face rule in their CSS code. This allows the user to define the name of the font family, the location of the font file, and other properties related to the font.


@font-face {

/* Define the name of your font family */
font-family: 'CustomFont';

/* Specify the path to your font file */
src: url('path/to/your/font/file.ttf');

}

body {

/* Apply the custom font to your elements */
font-family: 'CustomFont', sans-serif;

}

Accepted Font Types:

  • TTF (.ttf)

  • OTF (.otf)

  • WOFF (.woff)

  • WOFF2 (.woff2)

Uploading a PDF File

To upload a PDF to your program:

  1. Navigate to the More tab, located on the right side of the IDE

  2. Select Upload from the drop-down menu > click Upload File

  3. Locate your PDF on your computer (the file will be temporarily grayed out or unavailable)

  4. Click Show Options, located at the bottom of the pop-up modal

  5. Change the Format field from Custom Files to All Files > Click Open to upload your PDF

.gif of uploading a pdf file to a codehs program

Uploading a file in Multi-File Programs

Some program types on CodeHS, such as Java and HTML, allow you to create multiple files for your program. Note: Multi-file programs are not supported with all assignment types.

  1. Click New > Upload File

  2. Drag and Drop the file or choose Browse

  3. Open > Add File

Gif showing how to upload image on multi file programs.

The uploaded file will be added to the file tree in your Code Editor. If uploading an image file, you can copy and paste the URL to use in your program. Learn more about Creating & Managing Multi-file Programs.

Accepted File types:

  • HTML (.html)

  • JS (.js)

  • CSS (.css)

  • JAR (.jar)

  • PDF (.pdf)

  • TXT (.txt)

List of Uploaded Files

To see a list of every file that's been uploaded to your account and its URL:

  1. Go to Account Settings > Code History

  2. Under File Uploads, click My Uploads

access account settings in upper right


Still have questions? Contact our team at hello@codehs.com to learn more!

Did this answer your question?