How to download file from cloud storage to local drive using Aspose Cloud API?

Hello,

I might be missing something but I can’t find a simple way to return/download the file from storage.

If I use http://api.aspose.cloud/v1.1/storage/file it just returns a binary stream (Content-Type →application/octet-stream).

Is there a way to simple trigger a normal download of the file, saved with the same name and file extension as it is being stored as?

Thanks

@patrick_daly

Thank you for contacting us.

Please check Download a Particular File article, we have provided cURL Example as well as SDK Examples to download a file from Cloud Storage.

If you still have any confusion, please feel free to contact us.

But this is still an octet-stream: http://prntscr.com/kn6jxf

Is there any way to generate a normal file link for a user to click?

@patrick_daly

Is there any way to generate a normal file link for a user to click?

You cannot do this with Aspose Cloud Storage. But Aspose Cloud let you use third-party storage e.g. Dropbox, Google Drive, Amazon S3 as a Storage Provider.

We know Dropbox let us create a link that we can share with users to click/view the file. So let’s take Dropbox as an example.

First, go through Configure DropBox Storage article that explains how you can integrate your Dropbox Storage with Aspose Cloud. Once integrated, all files will be saved in your Dropbox Storage instead of Aspose Cloud Storage. At Dropbox, you can simply create “Share Link” of a file and share with your users to click/view the file.

I don’t mean a link like a sharing link, I just mean one that doesn’t return a binary/octet-stream.

It seems very strange that we can generate an XLSX file but your API doesn’t return an XLSX file - only binary.

@patrick_daly

It seems very strange that we can generate an XLSX file but your API doesn’t return an XLSX file - only binary.

The API returns XLSX file, you just have to save the returned response in .xlsx format.

I am not sure why are you trying to download the file via API Reference page? If you need a User Interface to download a file, please go to “My Files” section of Dashboard and download the desired file as shown in the following screenshot:

If you want to download a file via GET /storage/file API, please go through the Download a Particular File article it contains all the required details.

If you still have any confusion, we may arrange a Skype call and I will give you a live Demo on how to download a particular file.

@patrick_daly

As an update, if you have not already noticed it, the latest API version 3.0 of Aspose.Cells Cloud provides Storage APIs to work with cloud storage. Now, you do not need to use Aspose.Storage Cloud anymore. Please check the sample cURL command for downloading a file from Cloud storage.

# First get Access Token
# Get Customer Key and Customer ID from https://dashboard.aspose.cloud/
curl -X POST "https://api.aspose.cloud/connect/token" 
-d "grant_type=client_credentials&client_id=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx&client_secret=xxxxxxxxxxxxxxxxxxx" 
-H "Content-Type: application/x-www-form-urlencoded" 
-H "Accept: application/json"

# Download file from storage
curl -X GET "https://api.aspose.cloud/v3.0/cells/storage/file/Temp\Book1.xlsx" 
-H "accept: multipart/form-data" 
-H "authorization: Bearer [Access_Token]" 
--output C:/Temp/Book1.xlsx