microsoft / AzureStorageExplorer

Easily manage the contents of your storage account with Azure Storage Explorer. Upload, download, and manage blobs, files, queues, tables, and Cosmos DB entities. Gain easy access to manage your virtual machine disks. Work with either Azure Resource Manager or classic storage accounts, plus manage and configure cross-origin resource sharing (CORS) rules.
Creative Commons Attribution 4.0 International
377 stars 87 forks source link

Feature: Upload directory without including directory in target path #8276

Open Strepto opened 2 weeks ago

Strepto commented 2 weeks ago

Preflight Checklist

Problem

I want to upload a folder without the root folder. For example I'm uploading everything in a folder: C://MyStuff to a container: blob/mycontainer. I want the container to mirror the contents of my folder (recursively). Currently "mystuff" will be added to the path.

blob/mycontainer/mystuff/myfiles.txt

I want it to be blob/mycontainer/myfiles.txt (Imagine more files here of course)

More detailed example (:

blob/mycontainer/mystuff/
    myfiles.txt
    anotherfile.doc
    image.jpg
    folder1/
        fileinfolder1.txt

Desired Folder Structure in Azure:

blob/mycontainer/  <-- Without mystuff folder
    myfiles.txt
    anotherfile.doc
    image.jpg
    folder1/
        fileinfolder1.txt

Screenshot of todays dialog, where I believed that the destination directory would rename the uploaded directory, but the actual destination will be: /EntwinePointTile_1.1/3/ept-data when I want all the data directly in the /EntwinePointTile_1.1/3/3/ directory Image

Desired Solution

Enable a checkbox for the --as-subdir=false property already existing in azcopy. This makes azcopy not upload the "root" (selected-folder) folder as a folder in Azure, it just adds the contents of the folders directly, WHILE keeping the folder hierarchy below the "uploaded" folder.

Alternatives and Workarounds

Start the command, cancel it and manually run the azcopy command with the --as-subdir=false

Additional Context

No response

craxal commented 2 weeks ago

@Strepto What if you instead select "Upload Files" and select all the files/folders in the directory you want to upload? Does that accomplish what you're trying to do?

Strepto commented 2 weeks ago

@craxal I tested this now, and its not possible to upload entire directories with the "Upload Files" dialog as far as I can see. So then I would have to upload each sub directory manually.

So I COULD upload all root files to the blob root, but would have to start upload of each subdirectory manually. With the --as-subdir=false this would all be automated for me.