How to upload compressed content to the cloud?

Hello,
I would like to upload to the cloud some files I never hardly use. Is it possible to upload them as compressed to the cloud without me needing to compress them myself?
Thanks,

1 Like

Hi @brandonkeithbiggs,
odrive doesn’t currently compress anything prior to uploading. It is something we’ve discussed as a possible feature, though. If you wanted to upload compressed, you would need to compress the data yourself.

Is the goal to save cloud storage space?

1 Like

Yes, it is so I can have all my school documents and old files that I don’t use that much. I would put them in a cold storrage like google nearline, but I would like to have the leaste amount of storage possible. What I want to be able to do is upload these documents, then once in a while, view one or two documents.

1 Like

I see.

For now it sounds like you would want to individually compress each file and then upload. This way you have compression and can download specific files, in the future, without downloading a massive archive file.

1 Like

The problem is that I am talking about 50 gig uncompressed. There are way over 100000 files which is why I am looking to reduce space. I have no idea how to compress individual files in a batch process like this.

Hi @brandonkeithbiggs

Here is a powershell script that can be used to zip everything up (that isn’t already a .zip) and then send the original to the recycle bin, if the zip is tested as valid. This was tested on Windows 10.

You should test this on a small test folder with several files/folders, to verify it does what you want before using it on your real data.

  • You will need 7zip installed: http://www.7-zip.org/download.html

  • This script does not interact with odrive at all. You will need to copy/move the files to odrive after it completes if you want the files to be uploaded.

  • $path_to_zip needs to be changed to the folder you want to zip.

Script:

$7zip_bin="$env:programfiles\7-Zip\7z.exe"
$path_to_zip="$HOME\Desktop\temp\Test"
$7zip_log="$HOME\Desktop\7z_log.txt"
echo "" > "$7zip_log"
Add-Type -AssemblyName Microsoft.VisualBasic

dir -FILE -PATH "$path_to_zip\*" -Exclude *.zip -RECURSE | % {
    & "$7zip_bin" a "$($_.FullName).zip" "$($_.FullName)" >> "$7zip_log"; 
    if (Test-Path "$($_.FullName).zip"){
        $test_result = $(& "$7zip_bin" t "$($_.FullName).zip")
        if ($test_result -contains 'Everything is Ok'){ 
             echo "$($_.FullName) zipped successfully. Moving original to the recycle bin"
             [Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile("$($_.FullName)",'OnlyErrorDialogs','SendToRecycleBin')
         }
         else {
                 echo "There was an issue zipping $($_.FullName). The zip file is corrupt. Deleting."
                 Remove-Item "$($_.FullName).zip"
        }
    }
    else{
		echo "$($_.FullName) was not zipped, for some reason. Check $7zip_log"
    }
}
echo "Done processing $path_to_zip. Check $7zip_log for zip details."
3 Likes

Perfect thanks! What I would like to have is Odrive compress and uncompress files so I don’t even notice. rather than a .cloud ext it could be .zcloud or .cloudz.
Thanks,

Hi @brandonkeithbiggs,
When you get a chance, can you add a post to the Feature Requests section, so your request can be tracked properly?

Thanks!