This module allows you to upload files to the cloud that can later be accessed through their respective URLs. Uploading files to the cloud is especially useful for Mobile/Device Apps as this minimizes the App footprint on the device.
In order to use various functions available in a specific API, a developer has to create an instance of ServiceAPI by passing the apiKey and secretKey which will be created after the app creation from AppHQ dashboard.
Required Parameters
apiKey - The Application key given when the application was created.
secretKey - The secret key corresponding to the application key given when the application was created.
ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");ServiceAPI *api = [[ServiceAPI alloc]init]; api.apiKey = @"<API_KEY>"; api.secretKey = @"<SECRET_KEY>";ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");App42.initialize("API_KEY","SECRET_KEY");ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");$api = new ServiceAPI("API_KEY","SECRET_KEY");api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")Coming Soon
After initialization, developer needs to call the buildXXXService method on ServiceAPI instance to get the instance of the particular API that you wish to build. For example, To build an instance of UploadService, buildUploadService() method needs to be called.
UploadService uploadService = api.buildUploadService();UploadService uploadService = api.BuildUploadService();UploadService *uploadService = [api buildUploadService];UploadService uploadService = api.buildUploadService();UploadService uploadService = api.buildUploadService();var uploadService = new App42Upload();UploadService uploadService = api.BuildUploadService();$uploadService = $api->buildUploadService();uploadService = api.buildUploadService()Coming Soon
import com.shephertz.app42.paas.sdk.android.ServiceAPI; import com.shephertz.app42.paas.sdk.android.App42Response; import com.shephertz.app42.paas.sdk.android.App42Exception; import com.shephertz.app42.paas.sdk.android.App42BadParameterException; import com.shephertz.app42.paas.sdk.android.App42NotFoundException; import com.shephertz.app42.paas.sdk.android.upload.Upload; import com.shephertz.app42.paas.sdk.android.upload.UploadFileType; import com.shephertz.app42.paas.sdk.android.upload.UploadService;using com.shephertz.app42.paas.sdk.windows; using com.shephertz.app42.paas.sdk.windows.upload;#import "Shephertz_App42_iOS_API/Shephertz_App42_iOS_API.h"import com.shephertz.app42.paas.sdk.jme.ServiceAPI; import com.shephertz.app42.paas.sdk.jme.App42Response; import com.shephertz.app42.paas.sdk.jme.App42Exception; import com.shephertz.app42.paas.sdk.jme.App42BadParameterException; import com.shephertz.app42.paas.sdk.jme.App42NotFoundException; import com.shephertz.app42.paas.sdk.jme.upload.Upload; import com.shephertz.app42.paas.sdk.jme.upload.UploadFileType; import com.shephertz.app42.paas.sdk.jme.upload.UploadService;import com.shephertz.app42.paas.sdk.java.ServiceAPI; import com.shephertz.app42.paas.sdk.java.App42Response; import com.shephertz.app42.paas.sdk.java.App42Exception; import com.shephertz.app42.paas.sdk.java.App42BadParameterException; import com.shephertz.app42.paas.sdk.java.App42NotFoundException; import com.shephertz.app42.paas.sdk.java.upload.Upload; import com.shephertz.app42.paas.sdk.java.upload.UploadFileType; import com.shephertz.app42.paas.sdk.java.upload.UploadService;<script type="text/javascript" src="App42-all-x.x.x.min.js"></script>using com.shephertz.app42.paas.sdk.csharp; using com.shephertz.app42.paas.sdk.csharp.upload;use com\shephertz\app42\paas\sdk\php\App42Response; use com\shephertz\app42\paas\sdk\php\App42Exception; use com\shephertz\app42\paas\sdk\php\App42BadParameterException; use com\shephertz\app42\paas\sdk\php\App42NotFoundException; use com\shephertz\app42\paas\sdk\php\upload\UploadService; use com\shephertz\app42\paas\sdk\php\ServiceAPI; include_once '../UploadService.php'; include_once '../ServiceAPI.php'; include_once '../App42Response.php'; include_once '../App42Exception.php'; include_once '../App42BadParameterException.php'; include_once '../App42NotFoundException.php';Coming SoonComing Soon
Uploads file on the cloud.
Required Parameters
fileName - The name for the file which has to be saved. It is used to retrieve the file
filePath - The local path for the file
fileType - The type of the file. File can be either Audio, Video, Image, Binary, Txt, xml, json, csv or other Use the static constants e.g. Upload.AUDIO, Upload.XML etc.
description - Description of the file to be uploaded.
String fileName = "FileName"; String description = "File Description"; String filePath = "Your Local File Path"; Upload upload = uploadService.uploadFile(fileName,filePath,fileType.IMAGE,description); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();Not AvailableNSString *fileName = @"FileName.ext"; NSString *description = @"File Description"; NSString *filePath = @"Your Local File Path"; Upload *upload = [uploadService uploadFile:fileName filePath:filePath uploadFileType:@"IMAGE" fileDescription:description]; NSLog(@"fileName is %@" , [(File *)[upload.fileListArray objectAtIndex:0] name]); NSLog(@"fileType is %@" , [(File *)[upload.fileListArray objectAtIndex:0] type]); NSLog(@"fileDescription is %@" , [(File *)[upload.fileListArray objectAtIndex:0] description]); NSString *jsonResponse = [upload toString];Not AvailableString fileName = "FileName"; String description = "File Description"; String filePath = "Your Local File Path"; Upload upload = uploadService.uploadFile(fileName,filePath,fileType.IMAGE,description); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();var fileName = "FileName", description = "File Description", filePath = "Your Local File Path", result ; uploadService.uploadFile(fileName,filePath,"IMAGE",description,{ success: function(object) { var uploadObj = JSON.parse(object); result = uploadObj.app42.response.upload; console.log("result is " + result) }, error: function(error) { } });String fileName = "FileName"; String description = "File Description"; String filePath = "Your Local File Path"; Upload upload = uploadService.UploadFile(fileName,filePath,"IMAGE",description); Console.WriteLine("fileName is " + upload.GetFileList()[0].GetName()); Console.WriteLine("fileType is " + upload.GetFileList()[0].GetType()); Console.WriteLine("fileUrl is " + upload.GetFileList()[0].GetUrl()); Console.WriteLine("fileDescription is " + upload.GetFileList()[0].GetDescription()); String jsonResponse = upload.ToString();$fileName = "FileName"; $fileType = "IMAGE"; $filePath = "Your Local File Path"; $description = "File Description"; $upload = $uploadService->uploadFile($fileName, $filePath, $fileType, $description); print_r("fileName is " . $upload->getFileList()[0]->getName()); print_r("fileType is " . $upload->getFileList()[0]->getType()); $jsonResponse = $upload->toString();Coming SoonComing Soon
Gets all the files for the App.
Upload upload = uploadService.getAllFiles(); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();public class Callback : App42Callback { uploadService.GetAllFiles(this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Upload upload = (Upload) response; String jsonResponse = upload.ToString(); } }Upload *upload = [uploadService getAllFiles]; NSLog(@"fileName is %@" , [(File *)[upload.fileListArray objectAtIndex:0] name]); NSLog(@"fileType is %@" , [(File *)[upload.fileListArray objectAtIndex:0] type]); NSLog(@"fileDescription is %@" , [(File *)[upload.fileListArray objectAtIndex:0] description]); NSString *jsonResponse = [upload toString];Upload upload = uploadService.getAllFiles(); System.out.println("fileName is " + ((Upload.File)upload.getFileList().elementAt(0)).getName()); System.out.println("fileType is " + ((Upload.File)upload.getFileList().elementAt(0)).getType()); System.out.println("fileUrl is " + ((Upload.File)upload.getFileList().elementAt(0)).getUrl()); System.out.println("fileDescription is " + ((Upload.File)upload.getFileList().elementAt(0)).getDescription()); String jsonResponse = upload.toString();Upload upload = uploadService.getAllFiles(); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();var result ; uploadService.getAllFiles({ success: function(object) { var uploadObj = JSON.parse(object); result = uploadObj.app42.response.upload; console.log("result is " + result) }, error: function(error) { } });Upload upload = uploadService.GetAllFiles(); Console.WriteLine("fileName is " + upload.GetFileList()[0].GetName()); Console.WriteLine("fileType is " + upload.GetFileList()[0].GetType()); Console.WriteLine("fileUrl is " + upload.GetFileList().get(0).GetUrl()); Console.WriteLine("fileDescription is " + upload.GetFileList()[0].GetDescription()); String jsonResponse = upload.ToString();$upload = $uploadService->getAllFiles(); print_r("fileName is " . $upload->getFileList()[0]->getName()); print_r("fileType is " . $upload->getFileList()[0]->getType()); $jsonResponse = $upload->toString();Coming SoonComing Soon
Gets count of all the files for the App.
App42Response response = uploadService.getAllFilesCount(); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();public class Callback : App42Callback { uploadService.GetAllFilesCount(this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { App42Response upload = (App42Response) response; String jsonResponse = upload.ToString(); } }App42Response *response = [uploadService getAllFilesCount]; NSString *success = response.isResponseSuccess; NSString *jsonResponse = [response toString];App42Response response = uploadService.getAllFilesCount(); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();App42Response response = uploadService.getAllFilesCount(); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();Coming SoonApp42Response response = uploadService.GetAllFilesCount(); Boolean success = response.IsResponseSuccess(); String jsonResponse = response.ToString();$response = $uploadService->getAllFilesCount(); $success = $respons->isResponseSuccess(); $jsonResponse = $respons->toString();Coming SoonComing Soon
Gets all the files for the App.
Required Parameters
max - Maximum number of records to be fetched.
offset - From where the records are to be fetched.
int max = 1; int offset = 0; Upload upload = uploadService.getAllFiles(max,offset); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();public class Callback : App42Callback { int max = 1; int offset = 0; uploadService.GetAllFiles(max,offset,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Upload upload = (Upload) response; String jsonResponse = upload.ToString(); } }int max = 1; int offset = 0; Upload *upload = [uploadService getAllFiles:max offset:offset]; NSLog(@"fileName is %@" , [(File *)[upload.fileListArray objectAtIndex:0] name]); NSLog(@"fileType is %@" , [(File *)[upload.fileListArray objectAtIndex:0] type]); NSLog(@"fileDescription is %@" , [(File *)[upload.fileListArray objectAtIndex:0] description]); NSString *jsonResponse = [upload toString];Integer max = new Integer(1); Integer offset = new Integer(0); Upload upload = uploadService.getAllFiles(max,offset); System.out.println("fileName is " + ((Upload.File)upload.getFileList().elementAt(0)).getName()); System.out.println("fileType is " + ((Upload.File)upload.getFileList().elementAt(0)).getType()); System.out.println("fileUrl is " + ((Upload.File)upload.getFileList().elementAt(0)).getUrl()); System.out.println("fileDescription is " + ((Upload.File)upload.getFileList().elementAt(0)).getDescription()); String jsonResponse = upload.toString();int max = 1; int offset = 0; Upload upload = uploadService.getAllFiles(max,offset); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();var max = 1, offset = 0; var result ; uploadService.getAllFilesByPaging(max,offset,{ success: function(object) { var uploadObj = JSON.parse(object); result = uploadObj.app42.response.upload; console.log("result is " + result) }, error: function(error) { } });int max = 1; int offset = 0; Upload upload = uploadService.GetAllFiles(max,offset); Console.WriteLine("fileName is " + upload.GetFileList()[0].GetName()); Console.WriteLine("fileType is " + upload.GetFileList()[0].GetType()); Console.WriteLine("fileUrl is " + upload.GetFileList().get(0).GetUrl()); Console.WriteLine("fileDescription is " + upload.GetFileList()[0].GetDescription()); String jsonResponse = upload.ToString();$max = 1; $offset = 0; $upload = $uploadService->getAllFiles($max,$offset); print_r("fileName is " . $upload->getFileList()[0]->getName()); print_r("fileType is " . $upload->getFileList()[0]->getType()); $jsonResponse = $upload->toString();Coming SoonComing Soon
Gets the file based on file name.
Required Parameters
fileName - The name of the file which has to be retrieved
String fileName = "FileName"; Upload upload = uploadService.getFileByName(fileName); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();public class Callback : App42Callback { String fileName = "FileName"; uploadService.GetFileByName(fileName,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Upload upload = (Upload) response; String jsonResponse = upload.ToString(); } }NSString *fileName = @"FileName"; Upload *upload = [uploadService getFileByName:fileName]; NSLog(@"fileName is %@" , [(File *)[upload.fileListArray objectAtIndex:0] name]); NSLog(@"fileType is %@" , [(File *)[upload.fileListArray objectAtIndex:0] type]); NSLog(@"fileDescription is %@" , [(File *)[upload.fileListArray objectAtIndex:0] description]); NSString *jsonResponse = [upload toString];String fileName = "FileName"; Upload upload = uploadService.getFileByName(fileName); System.out.println("fileName is " + ((Upload.File)upload.getFileList().elementAt(0)).getName()); System.out.println("fileType is " + ((Upload.File)upload.getFileList().elementAt(0)).getType()); System.out.println("fileUrl is " + ((Upload.File)upload.getFileList().elementAt(0)).getUrl()); System.out.println("fileDescription is " + ((Upload.File)upload.getFileList().elementAt(0)).getDescription()); String jsonResponse = upload.toString();String fileName = "FileName"; Upload upload = uploadService.getFileByName(fileName); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();var fileName = "FileName"; var result ; uploadService.getFileByName(fileName,{ success: function(object) { var uploadObj = JSON.parse(object); result = uploadObj.app42.response.upload; console.log("result is " + result) }, error: function(error) { } });String fileName = "FileName"; Upload upload = uploadService.GetFileByName(fileName); Console.WriteLine("fileName is " + upload.GetFileList()[0].GetName()); Console.WriteLine("fileType is " + upload.GetFileList()[0].GetType()); Console.WriteLine("fileUrl is " + upload.GetFileList().get(0).GetUrl()); Console.WriteLine("fileDescription is " + upload.GetFileList()[0].GetDescription()); String jsonResponse = upload.ToString();$fileName = "FileName"; $upload = $uploadService->getFileByName($fileName); print_r("fileName is " . $upload->getFileList()[0]->getName()); print_r("fileType is " . $upload->getFileList()[0]->getType()); print_r("fileUrl is " . $upload->getFileList()[0]->getUrl()); $jsonResponse = $upload->toString();Coming SoonComing Soon
Get the files based on file type.
Required Parameters
fileType - Type of the file e.g. UploadFileType.AUDIO, UploadFileType.XML etc.
String fileType = "Your File Type"; Upload upload = uploadService.getFilesByType(fileType); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();public class Callback : App42Callback { String fileType = "Your File Type"; uploadService.GetFilesByType(fileType,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Upload upload = (Upload) response; String jsonResponse = upload.ToString(); } }NSString *fileType = @"Your File Type"; Upload *upload = [uploadService getFilesByType:fileType]; NSLog(@"fileName is %@" , [(File *)[upload.fileListArray objectAtIndex:0] name]); NSLog(@"fileType is %@" , [(File *)[upload.fileListArray objectAtIndex:0] type]); NSLog(@"fileDescription is %@" , [(File *)[upload.fileListArray objectAtIndex:0] description]); NSString *jsonResponse = [upload toString];String fileType = "Your File Type"; Upload upload = uploadService.getFilesByType(fileType); System.out.println("fileName is " + ((Upload.File)upload.getFileList().elementAt(0)).getName()); System.out.println("fileType is " + ((Upload.File)upload.getFileList().elementAt(0)).getType()); System.out.println("fileUrl is " + ((Upload.File)upload.getFileList().elementAt(0)).getUrl()); System.out.println("fileDescription is " + ((Upload.File)upload.getFileList().elementAt(0)).getDescription()); String jsonResponse = upload.toString();String fileType = "Your File Type"; Upload upload = uploadService.getFilesByType(fileType); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();var fileType = "Your File Type"; var result ; uploadService.getFilesByType(fileType,{ success: function(object) { var uploadObj = JSON.parse(object); result = uploadObj.app42.response.upload; console.log("result is " + result) }, error: function(error) { } });String fileType = "Your File Type"; Upload upload = uploadService.GetFilesByType(fileType); Console.WriteLine("fileName is " + upload.GetFileList()[0].GetName()); Console.WriteLine("fileType is " + upload.GetFileList()[0].GetType()); Console.WriteLine("fileUrl is " + upload.GetFileList().get(0).GetUrl()); Console.WriteLine("fileDescription is " + upload.GetFileList()[0].GetDescription()); String jsonResponse = upload.ToString();$fileType = "Your File Type"; $upload = $uploadService->getFilesByType($fileType); print_r("fileName is " . $upload->getFileList()[0]->getName()); print_r("fileType is " . $upload->getFileList()[0]->getType()); print_r("fileUrl is " . $upload->getFileList()[0]->getUrl()); $jsonResponse = $upload->toString();Coming SoonComing Soon
Get the count of files based on file type.
Required Parameters
fileType - Type of the file e.g. UploadFileType.AUDIO, UploadFileType.XML etc.
String fileType = "Your File Type"; App42Response response = uploadService.getFilesCountByType(fileType); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();public class Callback : App42Callback { String fileType = "Your File Type"; uploadService.GetFilesCountByType(fileType,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { App42Response upload = (App42Response) response; String jsonResponse = upload.ToString(); } }NSString *fileType = @"Your File Type"; App42Response *response = [uploadService getFilesCountByType:fileType]; NSString *success = response.isResponseSuccess; NSString *jsonResponse = [response toString];String fileType = "Your File Type"; App42Response response = uploadService.getFilesCountByType(fileType); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();String fileType = "Your File Type"; App42Response response = uploadService.getFilesCountByType(fileType); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();Coming SoonString fileType = "Your File Type"; App42Response response = uploadService.GetFilesCountByType(fileType); Boolean success = response.IsResponseSuccess(); String jsonResponse = response.ToString();$fileType = "Your File Type"; $response = $uploadService->getFilesCountByType($fileType); $success = $respons->isResponseSuccess(); $jsonResponse = $respons->toString();Coming SoonComing Soon
Get the files based on file type by Paging.
Required Parameters
fileType - Type of the file e.g. UploadFileType.AUDIO, UploadFileType.XML etc.
max - Maximum number of records to be fetched.
offset - From where the records are to be fetched.
String fileType = "Your File Type"; int max = 1; int offset = 0; Upload upload = uploadService.getFilesByType(fileType,max,offset); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();public class Callback : App42Callback { String fileType = "Your File Type"; int max = 1; int offset = 0; uploadService.GetFilesByType(fileType,max,offset,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Upload upload = (Upload) response; String jsonResponse = upload.ToString(); } }NSString *fileType = @"Your File Type"; int max = 1; int offset = 0; Upload *upload = [uploadService getFilesByType:fileType max:max offset:offset]; NSLog(@"fileName is %@" , [(File *)[upload.fileListArray objectAtIndex:0] name]); NSLog(@"fileType is %@" , [(File *)[upload.fileListArray objectAtIndex:0] type]); NSLog(@"fileDescription is %@" , [(File *)[upload.fileListArray objectAtIndex:0] description]); NSString *jsonResponse = [upload toString];String fileType = "Your File Type"; Integer max = new Integer(1); Integer offset = new Integer(0); Upload upload = uploadService.getFilesByType(fileType,max,offset); System.out.println("fileName is " + ((Upload.File)upload.getFileList().elementAt(0)).getName()); System.out.println("fileType is " + ((Upload.File)upload.getFileList().elementAt(0)).getType()); System.out.println("fileUrl is " + ((Upload.File)upload.getFileList().elementAt(0)).getUrl()); System.out.println("fileDescription is " + ((Upload.File)upload.getFileList().elementAt(0)).getDescription()); String jsonResponse = upload.toString();String fileType = "Your File Type"; int max = 1; int offset = 0; Upload upload = uploadService.getFilesByType(fileType,max,offset); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();Coming SoonString fileType = "Your File Type"; int max = 1; int offset = 0; Upload upload = uploadService.GetFilesByType(fileType,max,offset); Console.WriteLine("fileName is " + upload.GetFileList()[0].GetName()); Console.WriteLine("fileType is " + upload.GetFileList()[0].GetType()); Console.WriteLine("fileUrl is " + upload.GetFileList().get(0).GetUrl()); Console.WriteLine("fileDescription is " + upload.GetFileList()[0].GetDescription()); String jsonResponse = upload.ToString();$fileType = "Your File Type"; $max = 1; $offset = 0; $upload = $uploadService->getFilesByType($fileType,$max,$offset); print_r("fileName is " . $upload->getFileList()[0]->getName()); print_r("fileType is " . $upload->getFileList()[0]->getType()); print_r("fileUrl is " . $upload->getFileList()[0]->getUrl()); $jsonResponse = $upload->toString();Coming SoonComing Soon
Removes the file based on file name.
Required Parameters
fileName - The name of the file which has to be removed
String fileName = "FileName"; App42Response response = uploadService.removeFileByName(fileName); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();public class Callback : App42Callback { String fileName = "FileName"; uploadService.RemoveFileByName(fileName,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { App42Response upload = (App42Response) response; String jsonResponse = upload.ToString(); } }NSString *fileName = @"FileName"; App42Response *response = [uploadService removeFileByName:fileName]; NSString *success = response.isResponseSuccess; NSString *jsonResponse = [response toString];String fileName = "FileName"; App42Response response = uploadService.removeFileByName(fileName); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();String fileName = "FileName"; App42Response response = uploadService.removeFileByName(fileName); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();Coming SoonString fileName = "FileName"; App42Response response = uploadService.RemoveFileByName(fileName); Boolean success = response.IsResponseSuccess(); String jsonResponse = response.ToString();$fileName = "FileName"; $response = $uploadService->removeFileByName($fileName); $success = $respons->isResponseSuccess(); $jsonResponse = $respons->toString();Coming SoonComing Soon
Removes all the files for the App.
App42Response response = uploadService.removeAllFiles(); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();public class Callback : App42Callback { uploadService.RemoveAllFiles(this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { App42Response upload = (App42Response) response; String jsonResponse = upload.ToString(); } }App42Response *response = [uploadService removeAllFiles]; NSString *success = response.isResponseSuccess; NSString *jsonResponse = [response toString];App42Response response = uploadService.removeAllFiles(); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();App42Response response = uploadService.removeAllFiles(); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();Coming SoonApp42Response response = uploadService.RemoveAllFiles(); Boolean success = response.IsResponseSuccess(); String jsonResponse = response.ToString();$response = $uploadService->removeAllFiles(); $success = $respons->isResponseSuccess(); $jsonResponse = $respons->toString();Coming SoonComing Soon
Uploads file on the cloud.
Required Parameters
name - The name for the file which has to be saved. It is used to retrieve the file
userName - The name of the user for which file has to be saved.
filePath - The local path for the file
fileType - The type of the file. File can be either Audio, Video, Image, Binary, Txt, xml, json, csv or other Use the static constants e.g. Upload.AUDIO, Upload.XML etc.
description - Description of the file to be uploaded.
String fileName = "FileName"; String userName = "Nick"; String description = "File Description"; String filePath = "Your Local File Path"; Upload upload = uploadService.uploadFileForUser(fileName,userName,filePath,fileType.IMAGE,description); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();Not AvailableNSString *fileName = @"FileName.ext"; NSString *userName = @"Nick"; NSString *description = @"File Description"; NSString *filePath = @"Your Local File Path"; Upload *upload = [uploadService uploadFileForUser:fileName userName:userName filePath:filePath uploadFileType:@"IMAGE" fileDescription:description]; NSLog(@"fileName is %@" , [(File *)[upload.fileListArray objectAtIndex:0] name]); NSLog(@"fileType is %@" , [(File *)[upload.fileListArray objectAtIndex:0] type]); NSLog(@"fileDescription is %@" , [(File *)[upload.fileListArray objectAtIndex:0] description]); NSString *jsonResponse = [upload toString];Not AvailableString fileName = "FileName"; String userName = "Nick"; String description = "File Description"; String filePath = "Your Local File Path"; Upload upload = uploadService.uploadFileForUser(fileName,userName,filePath,fileType.IMAGE,description); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();var fileName = "FileName", userName = "Nick", description = "File Description", filePath = "Your Local File Path", result ; uploadService.uploadFileForUser(fileName,userName,filePath,"IMAGE",description,{ success: function(object) { var uploadObj = JSON.parse(object); result = uploadObj.app42.response.upload; console.log("result is " + result) }, error: function(error) { } });String fileName = "FileName"; String userName = "Nick"; String description = "File Description"; String filePath = "Your Local File Path"; Upload upload = uploadService.UploadFileForUser(fileName,userName,filePath,"IMAGE",description); Console.WriteLine("fileName is " + upload.GetFileList()[0].GetName()); Console.WriteLine("fileType is " + upload.GetFileList()[0].GetType()); Console.WriteLine("fileUrl is " + upload.GetFileList().get(0).GetUrl()); Console.WriteLine("fileDescription is " + upload.GetFileList()[0].GetDescription()); String jsonResponse = upload.ToString();$fileName = "FileName"; $userName = "Nick"; $fileType = "IMAGE"; $filePath = "Your Local File Path"; $description = "File Description"; $upload = $uploadService->uploadFileForUser($fileName,$userName, $filePath, $fileType, $description); print_r("fileName is " . $upload->getFileList()[0]->getName()); print_r("fileType is " . $upload->getFileList()[0]->getType()); $jsonResponse = $upload->toString();Coming SoonComing Soon
Gets the file based on file name.
Required Parameters
fileName - The name of the file which has to be retrieved
userName - The name of the user for which file has to be retrieved.
String fileName = "FileName"; String userName = "Nick"; Upload upload = uploadService.getFileByUser(fileName,userName); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();public class Callback : App42Callback { String fileName = "FileName"; String userName = "Nick"; uploadService.GetFileByUser(fileName,userName,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Upload upload = (Upload) response; String jsonResponse = upload.ToString(); } }NSString *fileName = @"FileName"; NSString *userName = @"Nick"; Upload *upload = [uploadService getFileByUser:fileName userName:userName]; NSLog(@"fileName is %@" , [(File *)[upload.fileListArray objectAtIndex:0] name]); NSLog(@"fileType is %@" , [(File *)[upload.fileListArray objectAtIndex:0] type]); NSLog(@"fileDescription is %@" , [(File *)[upload.fileListArray objectAtIndex:0] description]); NSString *jsonResponse = [upload toString];String fileName = "FileName"; String userName = "Nick"; Upload upload = uploadService.getFileByUser(fileName,userName); System.out.println("fileName is " + ((Upload.File)upload.getFileList().elementAt(0)).getName()); System.out.println("fileType is " + ((Upload.File)upload.getFileList().elementAt(0)).getType()); System.out.println("fileUrl is " + ((Upload.File)upload.getFileList().elementAt(0)).getUrl()); System.out.println("fileDescription is " + ((Upload.File)upload.getFileList().elementAt(0)).getDescription()); String jsonResponse = upload.toString();String fileName = "FileName"; String userName = "Nick"; Upload upload = uploadService.getFileByUser(fileName,userName); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();var fileName = "FileName", userName = "Nick"; var result ; uploadService.getFileByUser(fileName,userName,{ success: function(object) { var uploadObj = JSON.parse(object); result = uploadObj.app42.response.upload; console.log("result is " + result) }, error: function(error) { } });String fileName = "FileName"; String userName = "Nick"; Upload upload = uploadService.GetFileByUser(fileName,userName); Console.WriteLine("fileName is " + upload.GetFileList()[0].GetName()); Console.WriteLine("fileType is " + upload.GetFileList()[0].GetType()); Console.WriteLine("fileUrl is " + upload.GetFileList().get(0).GetUrl()); Console.WriteLine("fileDescription is " + upload.GetFileList()[0].GetDescription()); String jsonResponse = upload.ToString();$fileName = "FileName"; $userName = "Nick"; $upload = $uploadService->getFileByUser($fileName,$userName); print_r("fileName is " . $upload->getFileList()[0]->getName()); print_r("fileType is " . $upload->getFileList()[0]->getType()); print_r("fileUrl is " . $upload->getFileList()[0]->getUrl()); $jsonResponse = $upload->toString();Coming SoonComing Soon
Get all the files based on user name.
Required Parameters
userName - The name of the user for which file has to be retrieved.
String userName = "Nick"; Upload upload = uploadService.getAllFilesByUser(userName); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();public class Callback : App42Callback { String userName = "Nick"; uploadService.GetAllFilesByUser(userName,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Upload upload = (Upload) response; String jsonResponse = upload.ToString(); } }NSString *userName = @"Nick"; Upload *upload = [uploadService getAllFilesByUser:userName]; NSLog(@"fileName is %@" , [(File *)[upload.fileListArray objectAtIndex:0] name]); NSLog(@"fileType is %@" , [(File *)[upload.fileListArray objectAtIndex:0] type]); NSLog(@"fileDescription is %@" , [(File *)[upload.fileListArray objectAtIndex:0] description]); NSString *jsonResponse = [upload toString];String userName = "Nick"; Upload upload = uploadService.getAllFilesByUser(userName); System.out.println("fileName is " + ((Upload.File)upload.getFileList().elementAt(0)).getName()); System.out.println("fileType is " + ((Upload.File)upload.getFileList().elementAt(0)).getType()); System.out.println("fileUrl is " + ((Upload.File)upload.getFileList().elementAt(0)).getUrl()); System.out.println("fileDescription is " + ((Upload.File)upload.getFileList().elementAt(0)).getDescription()); String jsonResponse = upload.toString();String userName = "Nick"; Upload upload = uploadService.getAllFilesByUser(userName); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();var userName = "Nick"; var result ; uploadService.getAllFilesByUser(userName,{ success: function(object) { var uploadObj = JSON.parse(object); result = uploadObj.app42.response.upload; console.log("result is " + result) }, error: function(error) { } });String userName = "Nick"; Upload upload = uploadService.GetAllFilesByUser(userName); Console.WriteLine("fileName is " + upload.GetFileList()[0].GetName()); Console.WriteLine("fileType is " + upload.GetFileList()[0].GetType()); Console.WriteLine("fileUrl is " + upload.GetFileList().get(0).GetUrl()); Console.WriteLine("fileDescription is " + upload.GetFileList()[0].GetDescription()); String jsonResponse = upload.ToString();$userName = "Nick"; $upload = $uploadService->getAllFilesByUser($userName); print_r("fileName is " . $upload->getFileList()[0]->getName()); print_r("fileType is " . $upload->getFileList()[0]->getType()); print_r("fileUrl is " . $upload->getFileList()[0]->getUrl()); $jsonResponse = $upload->toString();Coming SoonComing Soon
Get the count of files based on user name.
Required Parameters
userName - The name of the user for which file has to be retrieved.
String userName = "Nick"; App42Response response = uploadService.getAllFilesCountByUser(userName); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();public class Callback : App42Callback { String userName = "Nick"; uploadService.GetAllFilesCountByUser(userName,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { App42Response upload = (App42Response) response; String jsonResponse = upload.ToString(); } }NSString *userName = @"Nick"; App42Response *response = [uploadService getAllFilesCountByUser:userName]; NSString *success = response.isResponseSuccess; NSString *jsonResponse = [response toString];String userName = "Nick"; App42Response response = uploadService.getAllFilesCountByUser(userName); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();String userName = "Nick"; App42Response response = uploadService.getAllFilesCountByUser(userName); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();Coming SoonString userName = "Nick"; App42Response response = uploadService.GetAllFilesCountByUser(userName); Boolean success = response.IsResponseSuccess(); String jsonResponse = response.ToString();$userName = "Nick"; $response = $uploadService->getAllFilesCountByUser($userName); $success = $respons->isResponseSuccess(); $jsonResponse = $respons->toString();Coming SoonComing Soon
Gets all the files for the App.
Required Parameters
max - Maximum number of records to be fetched.
offset - From where the records are to be fetched.
userName - The name of the user for which file has to be retrieved.
String userName = "Nick"; int max = 1; int offset = 0; Upload upload = uploadService.getAllFilesByUser(userName,max,offset); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();public class Callback : App42Callback { String userName = "Nick"; int max = 1; int offset = 0; uploadService.GetAllFilesByUser(userName,max,offset,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Upload upload = (Upload) response; String jsonResponse = upload.ToString(); } }NSString *userName = @"Nick"; int max = 1; int offset = 0; Upload *upload = [uploadService getAllFilesByUser:userName max:max offset:offset]; NSLog(@"fileName is %@" , [(File *)[upload.fileListArray objectAtIndex:0] name]); NSLog(@"fileType is %@" , [(File *)[upload.fileListArray objectAtIndex:0] type]); NSLog(@"fileDescription is %@" , [(File *)[upload.fileListArray objectAtIndex:0] description]); NSString *jsonResponse = [upload toString];String userName = "Nick"; Integer max = new Integer(1); Integer offset = new Integer(0); Upload upload = uploadService.getAllFilesByUser(userName,max,offset); System.out.println("fileName is " + ((Upload.File)upload.getFileList().elementAt(0)).getName()); System.out.println("fileType is " + ((Upload.File)upload.getFileList().elementAt(0)).getType()); System.out.println("fileUrl is " + ((Upload.File)upload.getFileList().elementAt(0)).getUrl()); System.out.println("fileDescription is " + ((Upload.File)upload.getFileList().elementAt(0)).getDescription()); String jsonResponse = upload.toString();String userName = "Nick"; int max = 1; int offset = 0; Upload upload = uploadService.getAllFilesByUser(userName,max,offset); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();var userName = "Nick", max = 1, offset = 0; var result ; uploadService.getAllFilesByUserWithPaging(userName,max,offset,{ success: function(object) { var uploadObj = JSON.parse(object); result = uploadObj.app42.response.upload; console.log("result is " + result) }, error: function(error) { } });String userName = "Nick"; int max = 1; int offset = 0; Upload upload = uploadService.GetAllFilesByUser(userName,max,offset); Console.WriteLine("fileName is " + upload.GetFileList()[0].GetName()); Console.WriteLine("fileType is " + upload.GetFileList()[0].GetType()); Console.WriteLine("fileUrl is " + upload.GetFileList().get(0).GetUrl()); Console.WriteLine("fileDescription is " + upload.GetFileList()[0].GetDescription()); String jsonResponse = upload.ToString();$userName = "Nick"; $max = 1; $offset = 0; $upload = $uploadService->getAllFilesByUser($userName,$max,$offset); print_r("fileName is " . $upload->getFileList()[0]->getName()); print_r("fileType is " . $upload->getFileList()[0]->getType()); $jsonResponse = $upload->toString();Coming SoonComing Soon
Removes the file based on file name.
Required Parameters
fileName - The name of the file which has to be removed.
userName - The name of the user for which file has to be removed.
String userName = "Nick"; String fileName = "FileName"; App42Response response = uploadService.removeFileByUser(fileName,userName); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();public class Callback : App42Callback { String userName = "Nick"; String fileName = "FileName"; uploadService.RemoveFileByUser(fileName,userName,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { App42Response upload = (App42Response) response; String jsonResponse = upload.ToString(); } }NSString *userName = @"Nick"; NSString *fileName = @"FileName"; App42Response *response = [uploadService removeFileByUser:fileName userName:userName]; NSString *success = response.isResponseSuccess; NSString *jsonResponse = [response toString];String userName = "Nick"; String fileName = "FileName"; App42Response response = uploadService.removeFileByUser(fileName,userName); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();String userName = "Nick"; String fileName = "FileName"; App42Response response = uploadService.removeFileByUser(fileName,userName); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();Coming SoonString userName = "Nick"; String fileName = "FileName"; App42Response response = uploadService.RemoveFileByUser(fileName,userName); Boolean success = response.IsResponseSuccess(); String jsonResponse = response.ToString();$userName = "Nick"; $fileName = "FileName"; $response = $uploadService->removeFileByUser($fileName,userName); $success = $respons->isResponseSuccess(); $jsonResponse = $respons->toString();Coming SoonComing Soon
Removes the file based on file name.
Required Parameters
userName - The name of the user for which file has to be removed.
String userName = "Nick"; App42Response response = uploadService.removeAllFilesByUser(userName); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();public class Callback : App42Callback { String userName = "Nick"; uploadService.RemoveAllFilesByUser(userName,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { App42Response upload = (App42Response) response; String jsonResponse = upload.ToString(); } }NSString *userName = @"Nick"; App42Response *response = [uploadService removeAllFilesByUser:userName]; NSString *success = response.isResponseSuccess; NSString *jsonResponse = [response toString];String userName = "Nick"; App42Response response = uploadService.removeAllFilesByUser(userName); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();String userName = "Nick"; App42Response response = uploadService.removeAllFilesByUser(userName); boolean success = response.isResponseSuccess(); String jsonResponse = response.toString();Coming SoonString userName = "Nick"; App42Response response = uploadService.RemoveAllFilesByUser(userName); Boolean success = response.IsResponseSuccess(); String jsonResponse = response.ToString();$userName = "Nick"; $response = $uploadService->removeAllFilesByUser($userName); $success = $respons->isResponseSuccess(); $jsonResponse = $respons->toString();Coming SoonComing Soon
Uploads file on the cloud.
Required Parameters
fileName - The name for the file which has to be saved. It is used to retrieve the file
userName - The name for the user for which file has to be saved.
inputStream - InputStream of the file to be uploaded.
fileType - The type of the file. File can be either Audio, Video, Image, Binary, Txt, xml, json, csv or other Use the static constants e.g. Upload.AUDIO, Upload.XML etc.
description - Description of the file to be uploaded.
String fileName = "FileName.ext"; String userName = "Nick"; String description = "File Description"; InputStream inputStream = null; /* Get input stream from your source */ Upload upload = uploadService.uploadFileForUser(fileName, userName,inputStream,fileType.IMAGE,description); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();public class Callback : App42Callback { String fileName = "FileName.ext"; String userName = "Nick"; String description = "File Description"; Stream inputStream = null; /* Get input stream from your source */ uploadService.UploadFileForUser(fileName,userName,inputStream,"IMAGE",description,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Upload upload = (Upload) response; Console.WriteLine("fileName is " + upload.GetFileList()[0].GetName()); Console.WriteLine("fileType is " + upload.GetFileList()[0].GetType()); String jsonResponse = upload.ToString(); } }Coming SoonString fileName = "FileName.ext"; String userName = "Nick"; String description = "File Description"; InputStream inputStream = null ; /* Get inputStream from your source. */ Upload upload = uploadService.uploadFileForUser(fileName, userName,inputStream,fileType.IMAGE,description); System.out.println("fileName is " + ((Upload.File)upload.getFileList().elementAt(0)).getName()); System.out.println("fileType is " + ((Upload.File)upload.getFileList().elementAt(0)).getType()); System.out.println("fileUrl is " + ((Upload.File)upload.getFileList().elementAt(0)).getUrl()); System.out.println("fileDescription is " + ((Upload.File)upload.getFileList().elementAt(0)).getDescription()); String jsonResponse = upload.toString();String fileName = "FileName.ext"; String userName = "Nick"; String description = "File Description"; InputStream inputStream = null; /* Get input stream from your source */ Upload upload = uploadService.uploadFileForUser(fileName, userName,inputStream,fileType.IMAGE,description); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();Not AvailableString fileName = "FileName.ext"; String userName = "Nick"; String description = "File Description"; Stream inputStream = null; /* Get input stream from your source */ Upload upload = uploadService.UploadFileForUser(fileName, userName,inputStream,"IMAGE",description); Console.WriteLine("fileName is " + upload.GetFileList()[0].GetName()); Console.WriteLine("fileType is " + upload.GetFileList()[0].GetType()); Console.WriteLine("fileUrl is " + upload.GetFileList().get(0).GetUrl()); Console.WriteLine("fileDescription is " + upload.GetFileList()[0].GetDescription()); String jsonResponse = upload.ToString();Not AvailableComing SoonComing Soon
Uploads file on the cloud.
Required Parameters
name - The name for the file which has to be saved. It is used to retrieve the file
inputStream - InputStream of the file to be uploaded.
fileType - The type of the file. File can be either Audio, Video, Image, Binary, Txt, xml, json, csv or other Use the static constants e.g. Upload.AUDIO, Upload.XML etc.
description - Description of the file to be uploaded.
String fileName = "FileName.ext"; String description = "File Description"; InputStream inputStream = null; /* Get input stream from your source */ Upload upload = uploadService.uploadFile(fileName,inputStream,fileType.IMAGE,description); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();public class Callback : App42Callback { String fileName = "FileName.ext"; String description = "File Description"; Stream inputStream = null; /* Get input stream from your source */ uploadService.UploadFile(fileName,userName,inputStream,"IMAGE",description,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Upload upload = (Upload) response; String jsonResponse = upload.ToString(); } }Coming SoonString name = "FileName"; String description = "File Description"; InputStream inputStream = null ; /* Get inputStream from your source. */ Upload upload = uploadService.uploadFile(name,inputStream,fileType.IMAGE,description); System.out.println("fileName is " + ((Upload.File)upload.getFileList().elementAt(0)).getName()); System.out.println("fileType is " + ((Upload.File)upload.getFileList().elementAt(0)).getType()); System.out.println("fileUrl is " + ((Upload.File)upload.getFileList().elementAt(0)).getUrl()); System.out.println("fileDescription is " + ((Upload.File)upload.getFileList().elementAt(0)).getDescription()); String jsonResponse = upload.toString();String fileName = "FileName.ext"; String description = "File Description"; InputStream inputStream = null; /* Get input stream from your source */ Upload upload = uploadService.uploadFile(fileName,inputStream,fileType.IMAGE,description); System.out.println("fileName is " + upload.getFileList().get(0).getName()); System.out.println("fileType is " + upload.getFileList().get(0).getType()); System.out.println("fileUrl is " + upload.getFileList().get(0).getUrl()); System.out.println("fileDescription is " + upload.getFileList().get(0).getDescription()); String jsonResponse = upload.toString();Not AvailableString fileName = "FileName"; String description = "File Description"; Stream inputStream = null; /* Get input stream from your source */ Upload upload = uploadService.UploadFile(fileName,inputStream,"IAMGE",description); Console.WriteLine("fileName is " + upload.GetFileList()[0].GetName()); Console.WriteLine("fileType is " + upload.GetFileList()[0].GetType()); Console.WriteLine("fileUrl is " + upload.GetFileList()[0].GetUrl()); Console.WriteLine("fileDescription is " + upload.GetFileList()[0].GetDescription()); String jsonResponse = upload.ToString();Not AvailableComing SoonComing Soon
The functions available under File Upload API can throw some exceptions in abnormal conditions. Example of the same has been given below. E.g. If App developer is requesting for the files by type which is not in database, the function will throw the App42Exception (as shown below) with message as “Not Found” and the appErrorCode as “2102” and the details as “Files for the user ‘Nick’ do not exist”.
String userName = "Nick"; try { Upload upload = uploadService.getAllFilesByUser(userName); } catch(App42Exception ex) { int appErrorCode = ex.getAppErrorCode(); int httpErrorCode = ex.getHttpErrorCode(); if(appErrorCode == 2102) { // Handle here for Not found (Files for the User 'Nick' does not Exist ) } else if(appErrorCode == 1401){ // handle here for Client is not authorized } else if(appErrorCode == 1500){ // handle here for Internal Server Error } String jsonText = ex.getMessage(); }public class Callback : App42Callback { String userName = "Nick"; uploadService.GetAllFilesByUser(userName, this); void App42Callback.OnException(App42Exception exception) { int appErrorCode = exception.GetAppErrorCode(); int httpErrorCode = exception.GetHttpErrorCode(); if(appErrorCode == 2102) { // Handle here for Not found (Files for the User 'Nick' does not Exist ) } else if(appErrorCode == 1401){ // handle here for Client is not authorized } else if(appErrorCode == 1500){ // handle here for Internal Server Error } String jsonText = exception.GetMessage(); } void App42Callback.OnSuccess(Object response) { Upload upload = (Upload) response; String jsonResponse = upload.ToString(); } }NSString *userName = @"Nick"; @try { Upload *upload = [uploadService getAllFilesByUser:userName]; } @catch(App42Exception *exception) { int appErrorCode = exception.appErrorCode; int httpErrorCode = exception.httpErrorCode; if(appErrorCode == 2102) { // Handle here for Not found (Files for the User 'Nick' does not Exist ) } else if(appErrorCode == 1401){ // handle here for Client is not authorized } else if(appErrorCode == 1500){ // handle here for Internal Server Error } NSString *jsonText = exception.reason; }String userName = "Nick"; try { Upload upload = uploadService.getAllFilesByUser(userName); } catch(App42Exception ex) { int appErrorCode = ex.getAppErrorCode(); int httpErrorCode = ex.getHttpErrorCode(); if(appErrorCode == 2102) { // Handle here for Not found (Files for the User 'Nick' does not Exist ) } else if(appErrorCode == 1401){ // handle here for Client is not authorized } else if(appErrorCode == 1500){ // handle here for Internal Server Error } String jsonText = ex.getMessage(); }String userName = "Nick"; try { Upload upload = uploadService.getAllFilesByUser(userName); } catch(App42Exception ex) { int appErrorCode = ex.getAppErrorCode(); int httpErrorCode = ex.getHttpErrorCode(); if(appErrorCode == 2102) { // Handle here for Not found (Files for the User 'Nick' does not Exist ) } else if(appErrorCode == 1401){ // handle here for Client is not authorized } else if(appErrorCode == 1500){ // handle here for Internal Server Error } String jsonText = ex.getMessage(); }var userName = "Nick", appErrorCode ; uploadService.getAllFilesByUser(userName,{ success: function(object) { }, error: function(error) { var uploadObj = JSON.parse(error); appErrorCode = uploadObj.app42Fault.appErrorCode; if(appErrorCode == 2102) { // Handle here for Not found (Files for the User 'Nick' does not Exist ) } else if(appErrorCode == 1401){ // handle here for Client is not authorized } else if(appErrorCode == 1500){ // handle here for Internal Server Error } } });String userName = "Nick"; try { Upload upload = uploadService.GetAllFilesByUser(userName); } catch(App42Exception exception) { int appErrorCode = exception.GetAppErrorCode(); int httpErrorCode = exception.GetHttpErrorCode(); if(appErrorCode == 2102) { // Handle here for Not found (Files for the User 'Nick' does not Exist ) } else if(appErrorCode == 1401){ // handle here for Client is not authorized } else if(appErrorCode == 1500){ // handle here for Internal Server Error } String jsonText = exception.GetMessage(); }$userName = "Nick"; try { $upload = $uploadService->getAllFilesByUser($userName); } catch(App42Exception $exception) { $appErrorCode =$exception->getAppErrorCode(); $httpErrorCode = $exception->getHttpErrorCode(); if($appErrorCode == 2102) { // Handle here for Not found (Files for the User 'Nick' does not Exist ) } else if($appErrorCode == 1401){ // handle here for Client is not authorized } else if($appErrorCode == 1500){ // handle here for Internal Server Error } $jsonText = $exception->getMessage(); }Coming SoonComing Soon
Functions in Upload API might throw exceptions with following HTTP and Application Error Codes (along with their descriptions):
1400 - BAD REQUEST - The Request parameters are invalid.
1401 - UNAUTHORIZED - Client is not authorized.
1500 - INTERNAL SERVER ERROR - Internal Server Error. Please try again.
2100 - BAD REQUEST - The request parameters are invalid. File by the name '@name' already exists.
2101 - NOT FOUND - Files do not exist.
2102 - NOT FOUND - Files for the user '@userName' do not exist.
2103 - NOT FOUND - The file with the name '@name' does not exist.
2104 - NOT FOUND - There are no files to remove.
2105 - NOT FOUND - The file with type '@type' does not exist.
2106 - NOT FOUND - The number of files are less than the specified offset
2107 - NOT FOUND - The number of files for the user '@userName' are less than the specified offset
2108 - NOT FOUND - The number of files with type '@type' are less than the specified offset