DNAnexus Documentation
APIDownloadsIndex of dx CommandsLegal
  • Overview
  • Getting Started
    • DNAnexus Essentials
    • Key Concepts
      • Projects
      • Organizations
      • Apps and Workflows
    • User Interface Quickstart
    • Command Line Quickstart
    • Developer Quickstart
    • Developer Tutorials
      • Bash
        • Bash Helpers
        • Distributed by Chr (sh)
        • Distributed by Region (sh)
        • SAMtools count
        • TensorBoard Example Web App
        • Git Dependency
        • Mkfifo and dx cat
        • Parallel by Region (sh)
        • Parallel xargs by Chr
        • Precompiled Binary
        • R Shiny Example Web App
      • Python
        • Dash Example Web App
        • Distributed by Region (py)
        • Parallel by Chr (py)
        • Parallel by Region (py)
        • Pysam
      • Web App(let) Tutorials
        • Dash Example Web App
        • TensorBoard Example Web App
      • Concurrent Computing Tutorials
        • Distributed
          • Distributed by Region (sh)
          • Distributed by Chr (sh)
          • Distributed by Region (py)
        • Parallel
          • Parallel by Chr (py)
          • Parallel by Region (py)
          • Parallel by Region (sh)
          • Parallel xargs by Chr
  • User
    • Login and Logout
    • Projects
      • Project Navigation
      • Path Resolution
    • Running Apps and Workflows
      • Running Apps and Applets
      • Running Workflows
      • Running Nextflow Pipelines
      • Running Batch Jobs
      • Monitoring Executions
      • Job Notifications
      • Job Lifecycle
      • Executions and Time Limits
      • Executions and Cost and Spending Limits
      • Smart Reuse (Job Reuse)
      • Apps and Workflows Glossary
      • Tools List
    • Cohort Browser
      • Chart Types
        • Row Chart
        • Histogram
        • Box Plot
        • List View
        • Grouped Box Plot
        • Stacked Row Chart
        • Scatter Plot
        • Kaplan-Meier Survival Curve
      • Locus Details Page
    • Using DXJupyterLab
      • DXJupyterLab Quickstart
      • Running DXJupyterLab
        • FreeSurfer in DXJupyterLab
      • Spark Cluster-Enabled DXJupyterLab
        • Exploring and Querying Datasets
      • Stata in DXJupyterLab
      • Running Older Versions of DXJupyterLab
      • DXJupyterLab Reference
    • Using Spark
      • Apollo Apps
      • Connect to Thrift
      • Example Applications
        • CSV Loader
        • SQL Runner
        • VCF Loader
      • VCF Preprocessing
    • Environment Variables
    • Objects
      • Describing Data Objects
      • Searching Data Objects
      • Visualizing Data
      • Filtering Objects and Jobs
      • Archiving Files
      • Relational Database Clusters
      • Symlinks
      • Uploading and Downloading Files
        • Small File Sets
          • dx upload
          • dx download
        • Batch
          • Upload Agent
          • Download Agent
    • Platform IDs
    • Organization Member Guide
    • Index of dx commands
  • Developer
    • Developing Portable Pipelines
      • dxCompiler
    • Cloud Workstation
    • Apps
      • Introduction to Building Apps
      • App Build Process
      • Advanced Applet Tutorial
      • Bash Apps
      • Python Apps
      • Spark Apps
        • Table Exporter
        • DX Spark Submit Utility
      • HTTPS Apps
        • Isolated Browsing for HTTPS Apps
      • Transitioning from Applets to Apps
      • Third Party and Community Apps
        • Community App Guidelines
        • Third Party App Style Guide
        • Third Party App Publishing Checklist
      • App Metadata
      • App Permissions
      • App Execution Environment
        • Connecting to Jobs
      • Dependency Management
        • Asset Build Process
        • Docker Images
        • Python package installation in Ubuntu 24.04 AEE
      • Job Identity Tokens for Access to Clouds and Third-Party Services
      • Enabling Web Application Users to Log In with DNAnexus Credentials
      • Types of Errors
    • Workflows
      • Importing Workflows
      • Introduction to Building Workflows
      • Building and Running Workflows
      • Workflow Build Process
      • Versioning and Publishing Global Workflows
      • Workflow Metadata
    • Ingesting Data
      • Molecular Expression Assay Loader
        • Common Errors
        • Example Usage
        • Example Input
      • Data Model Loader
        • Data Ingestion Key Steps
        • Ingestion Data Types
        • Data Files Used by the Data Model Loader
        • Troubleshooting
      • Dataset Extender
        • Using Dataset Extender
    • Dataset Management
      • Rebase Cohorts and Dashboards
      • Assay Dataset Merger
      • Clinical Dataset Merger
    • Apollo Datasets
      • Dataset Versions
      • Cohorts
    • Creating Custom Viewers
    • Client Libraries
      • Support for Python 3
    • Walkthroughs
      • Creating a Mixed Phenotypic Assay Dataset
      • Guide for Ingesting a Simple Four Table Dataset
    • DNAnexus API
      • Entity IDs
      • Protocols
      • Authentication
      • Regions
      • Nonces
      • Users
      • Organizations
      • OIDC Clients
      • Data Containers
        • Folders and Deletion
        • Cloning
        • Project API Methods
        • Project Permissions and Sharing
      • Data Object Lifecycle
        • Types
        • Object Details
        • Visibility
      • Data Object Metadata
        • Name
        • Properties
        • Tags
      • Data Object Classes
        • Records
        • Files
        • Databases
        • Drives
        • DBClusters
      • Running Analyses
        • I/O and Run Specifications
        • Instance Types
        • Job Input and Output
        • Applets and Entry Points
        • Apps
        • Workflows and Analyses
        • Global Workflows
        • Containers for Execution
      • Search
      • System Methods
      • Directory of API Methods
      • DNAnexus Service Limits
  • Administrator
    • Billing
    • Org Management
    • Single Sign-On
    • Audit Trail
    • Integrating with External Services
    • Portal Setup
    • GxP
      • Controlled Tool Access (allowed executables)
  • Science Corner
    • Scientific Guides
      • Somatic Small Variant and CNV Discovery Workflow Walkthrough
      • SAIGE GWAS Walkthrough
      • LocusZoom DNAnexus App
      • Human Reference Genomes
    • Using Hail to Analyze Genomic Data
    • Open-Source Tools by DNAnexus Scientists
    • Using IGV Locally with DNAnexus
  • Downloads
  • FAQs
    • EOL Documentation
      • Python 3 Support and Python 2 End of Life (EOL)
    • Automating Analysis Workflow
    • Backups of Customer Data
    • Developing Apps and Applets
    • Importing Data
    • Platform Uptime
    • Legal and Compliance
    • Sharing and Collaboration
    • Product Version Numbering
  • Release Notes
  • Technical Support
  • Legal
Powered by GitBook

Copyright 2025 DNAnexus

On this page
  • Uploading Files
  • Uploading One File
  • Uploading Multiple Files
  • Uploading Directories
  • Uploading Files With Metadata
  • Properties
  • Tags
  • Advanced Options
  • Redirecting Uploaded Files
  • Uploading from stdin
  • Buffers
  • Hiding the Progress Bar

Was this helpful?

Export as PDF
  1. User
  2. Objects
  3. Uploading and Downloading Files
  4. Small File Sets

dx upload

Last updated 2 years ago

Was this helpful?

You can upload files to the DNAnexus platform using the command . You can also upload data using the DNAnexus , a fast and convenient command-line client. For uploading multiple or large files (>50 MB), we recommend that you use Upload Agent, which allows you to upload up to 1000 files concurrently and resume uploads in case of network interruption.

Uploading Files

Uploading One File

You can use the dx upload command followed by a file path to upload one local file.

$ dx upload /Users/alice/README.txt
[===========================================================>] Uploaded 597 of 597 bytes (100%) /Users/alice/README.txt
ID                  file-xxxx
Class               file
Project             project-xxxx
Folder              /
Name                README.txt
State               closing
Visibility          visible
Types               -
Properties          -
Tags                -
Outgoing links      -
Created             Sun Jan  1 12:00:01 2017
Created by          alice
Last modified       Sun Jan  1 12:00:02 2017
archivalState       "live"
Media type

You can use the —brief flag with the dx upload command to print only a DNAnexus ID rather than the output shown above. This flag is useful if you want to save the file ID of the uploaded file.

$ dx upload /Users/alice/README.txt --brief
file-xxxx

Uploading Multiple Files

You can also use the dx upload command followed by multiple file paths to upload multiple local files.

$ dx upload /Users/alice/README.txt /Users/bob/README.txt
[===========================================================>] Uploaded 597 of 597 bytes (100%) /Users/alice/README.txt
ID                  file-xxxx
Class               file
Project             project-xxxx
Folder              /
Name                README.txt
State               closing
Visibility          visible
Types               -
Properties          -
Tags                -
Outgoing links      -
Created             Sun Jan  1 09:00:01 2017
Created by          alice
Last modified       Sun Jan  1 09:00:02 2017
archivalState       "live"
Media type   
[===========================================================>] Uploaded 597 of 597 bytes (100%) /Users/bob/README.txt
ID                  file-xxxx
Class               file
Project             project-xxxx
Folder              /
Name                README.txt
State               closing
Visibility          visible
Types               -
Properties          -
Tags                -
Outgoing links      -
Created             Sun Jan  1 09:00:03 2017
Created by          alice
Last modified       Sun Jan  1 09:00:04 2017
archivalState       "live"
Media type

You can use the wildcard * to upload multiple files.

The following command will upload all of the files inside the /Users/alice/ directory. This directory should contain only files and not sub-directories.

$ dx upload /Users/alice/*
[===========================================================>] Uploaded 597 of 597 bytes (100%) /Users/alice/INSTALL.txt
ID                  file-xxxx
Class               file
Project             project-xxxx
Folder              /
Name                INSTALL.txt
State               closing
Visibility          visible
Types               -
Properties          -
Tags                -
Outgoing links      -
Created             Sun Jan  1 09:00:01 2017
Created by          alice
Last modified       Sun Jan  1 09:00:02 2017
archivalState       "live"
Media type   
[===========================================================>] Uploaded 597 of 597 bytes (100%) /Users/alice/README.txt
ID                  file-xxxx
Class               file
Project             project-xxxx
Folder              /
Name                README.txt
State               closing
Visibility          visible
Types               -
Properties          -
Tags                -
Outgoing links      -
Created             Sun Jan  1 09:00:03 2017
Created by          alice
Last modified       Sun Jan  1 09:00:04 2017
archivalState       "live"
Media type

Uploading Directories

You can specify the ‑r/‑‑recursive parameter with the dx upload command to recursively upload one or more directories or folders and maintain their respective structures.

$ dx upload -r /Users/alice
[===========================================================>] Uploaded 597 of 5977 bytes (100%) /Users/alice/INSTALL.txt
[===========================================================>] Uploaded 597 of 597 bytes (100%) /Users/alice/README.txt

$ dx upload -r /Users/alice /Users/bob
[===========================================================>] Uploaded 597 of 5977 bytes (100%) /Users/alice/INSTALL.txt
[===========================================================>] Uploaded 597 of 597 bytes (100%) /Users/alice/README.txt
[===========================================================>] Uploaded 597 of 597 bytes (100%) /Users/bob/README.txt
$ dx ls
Users/

$ dx ls Users
alice/
bob/

$ dx ls Users/alice
INSTALL.txt
README.txt

NOTE: If the local uploaded directory ends with the / character, only the contents of the directory will be uploaded, not the directory itself.

Uploading Files With Metadata

If multiple files are uploaded, tags and properties are applied to all of the files.

Properties

You can use the --property KEY=VALUE parameter to add metadata to the file being uploaded. The parameter may be repeated as necessary, e.g. --property key1=val1 --property key2=val2, to link multiple metadata fields as key-value pairs.

$ dx upload /Users/alice/README.txt --property name=alice
[===========================================================>] Uploaded 597 of 597 bytes (100%) /Users/alice/README.txt
ID                  file-xxxx
Class               file
Project             project-xxxx
Folder              /
Name                README.txt
State               closing
Visibility          visible
Types               -
Properties          name=alice
Tags                -
Outgoing links      -
Created             Sun Jan  1 09:00:01 2017
Created by          alice
Last modified       Sun Jan  1 09:00:02 2017
archivalState       "live"
Media type

Tags

You can also add tags to uploaded files with the dx upload command using the --tag TAGparameter. The parameter may be repeated as necessary, e.g. --tag tag1 --tag tag2, to link multiple tags to a file.

$ dx upload /Users/alice/README.txt --tag alice
[===========================================================>] Uploaded 597 of 597 bytes (100%) /Users/alice/README.txt
ID                  file-xxxx
Class               file
Project             project-xxxx
Folder              /
Name                README.txt
State               closing
Visibility          visible
Types               -
Properties          -
Tags                alice
Outgoing links      -
Created             Sun Jan  1 09:00:01 2017
Created by          alice
Last modified       Sun Jan  1 09:00:02 2017
archivalState       "live"
Media type

Advanced Options

Redirecting Uploaded Files

$ dx upload /Users/alice/README.txt --path /DNAnexus/User/
[===========================================================>] Uploaded 597 of 597 bytes (100%) /Users/alice/README.txt
ID                  file-xxxx
Class               file
Project             project-xxxx
Folder              /DNAnexus/User
Name                README.txt
State               closing
Visibility          visible
Types               -
Properties          -
Tags                alice
Outgoing links      -
Created             Sun Jan  1 09:00:01 2017
Created by          alice
Last modified       Sun Jan  1 09:00:02 2017
archivalState       "live"
Media type

Uploading from stdin

You can upload data directly from standard input. This is very useful when streaming the upload while the file is generated.

$ cat /Users/alice/README.txt | dx upload - --path README.txt
ID                  file-xxxx
Class               file
Project             project-xxxx
Folder              /
Name                README.txt
State               closing
Visibility          visible
Types               -
Properties          -
Tags                alice
Outgoing links      -
Created             Sun Jan  1 12:00:01 2017
Created by          alice
Last modified       Sun Jan  1 12:00:02 2017
archivalState       "live"
Media type

Buffers

You can specify the --buffer-size parameter with the dx upload command to set the write buffer size in bytes. When uploading large files from standard input, you will need to manually set a --buffer-size because the dx command does not know the file size beforehand.

$ cat /Users/alice/big_file.txt --path big_file.txt | dx upload - --buffer-size 1073741824
ID                  file-xxxx
Class               file
Project             project-xxxx
Folder              /
Name                big_file.txt
State               closing
Visibility          visible
Types               -
Properties          -
Tags                alice
Outgoing links      -
Created             Sun Jan  1 12:00:01 2017
Created by          alice
Last modified       Sun Jan  1 12:05:00 2017
archivalState       "live"
Media type

Hiding the Progress Bar

You can specify the --no-progress flag with the dx upload command to hide the progress bar.

$ dx upload /Users/alice/README.txt  --no-progress
ID                  file-xxxx
Class               file
Project             project-xxxx
Folder              /
Name                README.txt
State               closing
Visibility          visible
Types               -
Properties          -
Tags                alice
Outgoing links      -
Created             Sun Jan  1 12:00:01 2017
Created by          alice
Last modified       Sun Jan  1 12:00:02 2017
archivalState       "live"
Media type

If you are trying to upload a file hosted at a publicly accessible URL rather than locally, you can use the (platform login required to access this link) app.

You can use the command to list the uploaded folders and files.

You can specify object using the dx upload command.

You can use the --path/‑‑destination parameter to specify the DNAnexus destination path. If the path is not specified, dx upload will default to the current project and folder. You can determine your current project and folder using the command .

URL Fetcher
metadata
Upload Agent
dx upload
dx ls
dx pwd