Free Support Forum -

Upload Excel File to Cloud Storage for Excel to PDF conversion in Java using Aspose.Cells REST API

Hi Aspose Technical Support,

I’m using Aspose.Cloud for converting from Excel to PDF. Today (12-June-2014), we almost have errors in uploading Excel files to Aspose (from 08:34 GMT+07 to 10:40 GMT+07. After 10:40, everything is normal. Did you make any changes on Aspose.Cloud Server on that time ?

This is my code for upload files to Aspose in Java :

* Upload file into server
* @param data
* @param uploadUrl
* @return
private static String uploadFile(byte[] data, String uploadUrl,
Map<String, Object> outputData) {

// String uploadUrl =
// “”;
System.out.println("upload URL : " + uploadUrl);
try {
URL url = new URL(uploadUrl);
HttpURLConnection m_connection;
m_connection = (HttpURLConnection) url.openConnection();
// m_connection.setAllowUserInteraction(true);
// Increase the Connection Timeout
m_connection.setConnectTimeout(3 * 60 * 1000);

m_connection.setRequestProperty(“Accept”, “text/json”);
m_connection.setRequestProperty(“Content-length”, “” + data.length);
m_connection.connect(); out = new BufferedOutputStream(

InputStream response = m_connection.getInputStream();
String res = com.saaspose.common.Utils.StreamToString(response);

if (null != outputData) {
outputData.put(“resultUpload”, res);

// Parse result of uploading file for checking errors
JSONObject objResult = new JSONObject(res);
// {“Code”:200,“Status”:“OK”}
String code = objResult.getString(“Code”);
String status = objResult.getString(“Status”);
if (false == “200”.equalsIgnoreCase(code)) {
throw new Exception(“Code of upload != 200”);
if (false == “OK”.equalsIgnoreCase(status)) {
throw new Exception(“Status of upload != OK”);

return res;
} catch (Exception e) {
String exInfo = Utils.exceptionToString(e);
// e.printStackTrace();
log.severe("Exception in upload file : " + exInfo);

if (null != outputData) {
outputData.put(“exception”, exInfo);
return null;

And this is the error information :
Exception info : Could not fetch URL:$Connection.fetchResponse($Connection.getInputStream(





Hi Chien,

We did not make any changes but we will investigate why this issue arose at your end and let you know.

Best Regards,

Hi Chien,

Sorry we did not find and issue with your account or during those hours. Did you notice a similar issue after that?

Best Regards,


As an update, please note latest API Version V3 of Aspose.Cells Cloud has very simplified and improved code. It is better than previous versions in terms of API structure and memory management. Please find sample Aspose.Cells Cloud SDK for Java code to upload file to cloud storage. You can check latest SDK from Github Repo and feel free to ask any question or concern.

File file = new File("C:/Temp/test.xlsx");
    try {
    	 CellsApi api = new CellsApi(aapSID,aapKey);
    } catch (ApiException e) {
        // TODO Auto-generated catch block