Hi, I've created an XS project to use the sap.ui.commons.FileLoader API to upload a file to the XS server. I've included the sap.ui.demokit.FileUploadIntrospector so that I can check if the file has uploaded successfully. Everything looks good but when I test I'm unable to see the file in the Introspector window after I do the upload. The uploadComplete event fires successfully. I verified this by adding in an alert.
FileLoader
createContent : function(oController)
{
jQuery.sap.require("jquery.sap.resources");
var oPanel = new sap.ui.commons.Panel().setText("File Uploader Test 4");
var oFileUploader = new sap.ui.commons.FileUploader("MyFileLoader");
oFileUploader.setUploadUrl("../upload_dir");
oFileUploader.setUploadOnChange(true);
oFileUploader.attachUploadComplete(oController.doFileLoadComplete);
oPanel.addContent(oFileUploader);
var oButton = new sap.ui.commons.Button({
id : this.createId("MyButton"),
text : "Upload"
});
oButton.attachPress(function(){oFileUploader.upload();});
oPanel.addContent(oButton);
return oPanel;
}
FileUploadIntrospector
<script>
var oFileList = new sap.ui.demokit.FileUploadIntrospector({
uploadUrl : "../upload_dir-check",
autoRefreshInterval : 2000, /* ms */
height: '12em',
width: '95%'
});
oFileList.placeAt("upload-check");
</script>
</head>
<bodyclass="sapUiBody"role="application">
<divid="content"></div>
<h3>Upload Check</h3>
<p>To verify the results of the upload, check the following file list. It displays all
files in the upload area (server side) of this application and is updated automatically.</p>
<br><br>
<divid="upload-check"></div>
</body>
After upload I should see the file appear in the introspector window below
Any ideas why the file does not show up? Is there any other way to check if the upload worked?
To note: I created the folder "upload_dir" in my project as the destination folder for the upload. Is there anything special that I need to set up for this?
Any advice would be appreciated.
Thanks
Peter