Skip to content
Harald Schilly edited this page Jan 26, 2019 · 5 revisions

Uploading Files to CoCalc

with notes on large files and uploading from Google Drive

Three ways to upload

Here are the most common ways to upload a file from an external source to a CoCalc project.

1. Drag and drop

This method is convenient if you can select the file to be uploaded with a mouse or other pointing device and drag it into a CoCalc browser tab.

NOTE: We allow any size file in CoCalc, but the drag and drop file interface has a 256 MB limit on the size of the file that can be transferred. The other upload methods described below do not have this limit.

1. Click "+New", then scroll down to the box that says "Drop files to upload" and drag and drop there.

or

2. You can drag and drop right onto the Files listing. You have to drop the file onto some existing files in the listing (not below them).

2. Fetch

NOTE: Internet access must be enabled for your project for these methods to work.

1. Click +New, then paste a link where the filename would go and press return. This uses wget behind the scenes.

OR

2. Type wget url in a terminal.

OR

3. Type curl -LO url in a terminal.

3. SSH

This method uses the SSH protocol with scp or rsync from your computer's operating system.

To get started, you need to create an SSH key pair, consisting of a public key and a private key, on your computer, and install the public key in either your CoCalc account or a CoCalc project. There's more information on creating and installing keys here.

Then use one of the options below in a command-line terminal on your computer to copy the file into your project. Exact command syntax may vary depending on your computer's operating system.

For more information on setting up and using SSH with CoCalc, see this tutorial.

1. Use scp fromfile project:tofile from a command shell on your local computer.

OR

2. Use rsync -aVH fromfile -e ssh project:tofile from a command shell on your local computer.

Hints for dealing with large files

Here 'large' can mean anything from a few tens of megabytes to several gigabytes, whatever value at which uploads become a problem. The threshold may depend on local factors such as speed and quality of your internet connection.

  • As noted above, there is a hard limit of 256 MB for the drag and drop interface. Use fetch or SSH methods above for larger files.

  • Make sure your project has room for the files. Check in project Settings (wrench icon) > Project usage and quotas > Disk space.

  • Avoid transferring large files if you can. Compress files before uploading, or divide into chunks.

Uploading from Google Drive

Extra steps may be needed if you're uploading a file from Google Drive.

  1. Like the other "fetch" methods above, internet access must be enabled for your project.

  2. Share the file on Google Drive so CoCalc can access it.

  3. This stackoverflow posting explains that two GET requests are needed, and includes a Python script to make the requests.

Clone this wiki locally