Public
Like
10
FileDumpThing
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v119View latest version
A simple CLI tool for uploading files to the File Dumper service.
You can install the CLI tool globally using Deno:
deno install -grAf --allow-npm -n=fdt https://esm.town/v/wolf/FileDumpThing/cli/upload.ts
This command:
- Installs the tool globally (
-g
) - Reloads all dependencies to ensure the latest version (
-r
) - Grants all necessary permissions (
-A
) - Forces overwrite of any existing installation (
-f
) - Names the command
fdt
(-n=fdt
)
After installation, you can use the tool with the fdt
command:
cat image.png | fdt image.png
# Upload a file cat path/to/file.jpg | fdt file.jpg # Upload text echo "Hello World" | fdt note.txt # Upload without copying to clipboard cat image.png | fdt image.png --no-copy # Or use the full Deno command if not installed cat path/to/file.jpg | deno run --allow-net --allow-npm https://esm.town/v/wolf/FileDumpThing/cli/upload.ts file.jpg
The filename argument is optional but helps identify the file in the URL.
--no-copy
: Disables automatic copying of the URL to clipboard
By default, the CLI automatically copies the generated URL to your clipboard using the same library as the web interface. This works across all platforms without requiring any additional software.
If you don't want the URL to be copied, use the --no-copy
flag.
The CLI automatically detects whether the input is text or binary:
- Text content is uploaded as plain text (with .txt extension)
- Binary content is uploaded as a file (with .bin extension if no extension is provided)
This detection happens by checking for null bytes in the content.
# Upload and open in browser cat image.png | fdt image.png | xargs open # Upload without copying to clipboard cat document.pdf | fdt document.pdf --no-copy # Upload text from clipboard (macOS) pbpaste | fdt notes.txt
If you prefer not to install, you can create a shell alias:
# Add to your .bashrc, .zshrc, etc. alias fdt='deno run --allow-net --allow-npm https://esm.town/v/wolf/FileDumpThing/cli/upload.ts'
Then use:
cat image.png | fdt image.png
The CLI tool:
- Reads content from stdin
- Automatically detects if it's text or binary
- Uploads it to the API at
filedumpthing.val.run
- Returns a shareable URL
- Automatically copies the URL to your clipboard (unless
--no-copy
is specified)