CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/lib/share/download-url.ts
Views: 687
1
// See comment in raw-url for the definition. This is the same, but with "raw" replaced by "download".
2
3
import { encodePath } from "./raw-url";
4
import { join } from "path";
5
import basePath from "lib/base-path";
6
7
export default function downloadURL(
8
id: string,
9
path: string,
10
relativePath: string
11
): string {
12
return join(
13
basePath,
14
`share/download/${id}/${encodePath(join(path, relativePath))}`
15
);
16
}
17
18