DO Spaces

A Wrapper to interact with Digital Ocean Spaces.

Definition

Namespace: Tipi.Tools.Services

Assembly: Tipi.Tools.Services.dll

Package: Tipi.Tools.DoSpaces

This class lets you interact with Digital Ocean Spaces.

Methods

Uploads a new file to the provided folder, it takes the file as a BASE64 string.

Delete an existing file, it takes as parameters the url of the file you want to delete and the folder where it is located.

Update an existing file, it takes as parameters the new file as BASE64, the Url where it is currently store and the folder where it is stored. This method updated the content of the file and leaves it's location the same so your file will remain with the same access Url.

UploadFileAsync(string file, string folderName)

Uploads a new file to the provided folder, it takes the file as a BASE64 string.

Copied!

                    
    // upload a new image
    var response = await _dospaces.UploadFileAsync("file", "folder");
                    
                
DeleteFileAsync(string url, string folder)

Delete an existing file, it takes as parameters the url of the file you want to delete and the folder where it is located.

Copied!

                    
    // Delete an existing image
    var response = await _dospaces.DeleteFileAsync("fileUrl", "folder");
                    
                
UpdateFileAsync(string file, string folderName, string fileUrl)

Update an existing file, it takes as parameters the new file as BASE64, the Url where it is currently store and the folder where it is stored. This method updated the content of the file and leaves it's location the same so your file will remain with the same access Url.

Copied!

                    
    // upload a new image
    var response = await _dospaces.UpdateFileAsync("file", "folder", "file_url");