Free Support Forum - aspose.cloud

Microsoft Spreadsheet Excel files upload to cloud storage issue with Aspose.Storage Cloud SDK for Java

Hi Aspose’s Support,

I have converted Excel to Pdf as following sample :
Convert Excel Workbook to Different File Formats

I have been noticed that we can’t upload excel template files to Aspose’s Server today (29-July, from 00:11’ GMT+07 to 00:30’ GMT+07). Do you know what wrong with it in that time ?

Here is the Java code about upload file to Aspose’s Server :

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

try {
URL url = new URL(uploadUrl);
HttpURLConnection m_connection;
m_connection = (HttpURLConnection) url.openConnection();

// Increase the Connection Timeout
m_connection.setConnectTimeout(3 * 60 * 1000);

m_connection.setDoOutput(true);
m_connection.setRequestMethod(“PUT”);
m_connection.setRequestProperty(“Accept”, “text/json”);
m_connection.setRequestProperty(“Content-Type”,
“MultiPart/Form-Data”);
m_connection.setRequestProperty(“Content-length”, “” + data.length);
m_connection.connect();
java.io.OutputStream out = new BufferedOutputStream(
m_connection.getOutputStream());
out.write(data);
out.flush();

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

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 here is the extraction of exception information :

Exception info :
com.google.appengine.api.urlfetch.InternalTransientException: A
temporary internal error has occured. Please try again. URL: http://api.aspose.com/v1.1/storage/file/Reporte-Fotografico-Telcel-MX-Za0042-10233312-LUIS-ALFREDO-SALAZAR-RODRIGUEZ-28-07-2015-12-14-18-PM-_0598392.xlsx?appSID=febd886e-b9dc-4514-9deb-73f48f81dc71&signature=ZMewLhsWrF9pPNiOrOQGKILD6ggcom.google.appengine.api.urlfetch.URLFetchServiceImpl.convertApplicationException(URLFetchServiceImpl.java:145)

com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:45)

com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.fetchResponse(URLFetchServiceStreamHandler.java:502)

com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.getInputStream(URLFetchServiceStreamHandler.java:381)

com.mdt.doforms.portal.utils.AsposeCellsUtils.uploadFile(AsposeCellsUtils.java:131)

com.mdt.doforms.portal.utils.AsposeCellsUtils.getPdfDownloadDataNewMethod(AsposeCellsUtils.java:372)

com.mdt.doforms.portal.utils.AsposeCellsUtils.getPdfDownloadData(AsposeCellsUtils.java:182)

com.mdt.doforms.portal.utils.backend.PRExcel.createConvertPdf(PRExcel.java:420)

com.mdt.doforms.portal.utils.backend.PRUtils.processResultData(PRUtils.java:391)

com.mdt.doforms.portal.servlet.backend.WaitingProcessCallBackendServlet.processSingleRecordInBackendTaskQueue(WaitingProcessCallBackendServlet.java:181)

com.mdt.doforms.portal.servlet.backend.WaitingProcessCallBackendServlet.doPost(WaitingProcessCallBackendServlet.java:104)

javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

com.mdt.doforms.portal.servlet.ServletUtilBase.service(ServletUtilBase.java:500)

org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)

org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)

com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)

org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)

com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)

org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)

com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)

org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)

com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)

org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)

org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)

org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)

org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)

org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)

org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)

com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:257)

org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

org.mortbay.jetty.Server.handle(Server.java:326)

org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)

org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)

com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)

org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)

com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:146)

com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:482)

com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437)

com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)

com.google.tracing.CurrentContext.runInContext(CurrentContext.java:230)

com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)

com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)

com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)

com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:234)

java.lang.Thread.run(Thread.java:745)


Thanks,
Chien

Hi Chien,

The issue is under investigation. We will let you know once done.

Sorry for the inconvenience.

Best Regards,

Hi Chien,

Sorry, our product team was not able to find any reason behind this exception and service was up and running according to our logs. Please do share with us if you see such error again.

Best Regards,

@tdchien

For your information, please note, since API Version V3, we have included storage API methods in Aspose.Cells Cloud API for storage related operations. Now you do not need to use Aspose.Storage Cloud API for the purpose. Please check following code sample to upload a file to cloud storage. Please feel free to contact us for any assistance.

// Get App Key and App SID from https://dashboard.aspose.cloud/
CellsApi api = new CellsApi("xxxxx-xxxx-xxxx-xxxx-xxxxx","xxxxxxxxxxxxxxxxxxxxxxxxxxxx");
File file = new File("C:/Temp/Test.xlsx"));
	try {
		api.uploadFile( "Temp/Test.xlsx", file, null);
	} catch (ApiException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}