Reputation: 23
Hi I have tried Integrating FileUploader.js (DOJO WIDGET) to my sample project in order to Attach and Upload the file contents from local memory
Get the file from sdcard/internal memory and i want show that file in mobile device
When tested in mobile it's not working.
This is where the location of FileUploader.js is in my Project Explorer:
/dojoLib/toolkit/dojo/dojox/form/FileUploader.js
Please suggest.
JS code
require(['dojox/form/Uploader', 'dojox/form/uploader/plugins/Flash'], function(Uploader){
myUploader = new dojox.form.Uploader();
});
function dojoInit() {
require([ "dojo/ready", "dojo/parser", "dojox/mobile", "dojo/dom", "dijit/registry", "dojox/mobile/ScrollableView", "dojo/data/ItemFileReadStore", "dojo/data/ItemFileWriteStore", "dojox/mobile/SearchBox", "dojox/form/Uploader"], function(ready) {
ready(function() {
});
});
}
[html code--][1]
<div data-dojo-type="dojox.mobile.ScrollableView" id="view0" data-dojo-props="selected:true">
<form method="post" action="UploadFile.php" id="myForm" enctype="multipart/form-data" >
<input name="uploadedfile" multiple="true" type="file" data-dojo-type="dojox.form.Uploader" label="Select Some Files" id="uploader" />
<input type="submit" label="Submit" data-dojo-type="dijit.form.Button" />
</form>
</div>
Android in in app/res/xml/config.xml already have plugin
Android in app/AndroidManifest.xml already have plugin
Upvotes: -2
Views: 145
Reputation: 44516
Suggestions:
Here's why it is failing for you... When you test in a desktop browser, you are not in a mobile app. You are in a desktop browser. In a desktop browser in your PC you have access to the local filesystem and that's why the widget worked for you.
But when you are in a mobile device, you do not have access to the file system. You must request this access. To do so, you must use the Cordova FileSystem API. Please refer to that and implement accordingly based on their examples: https://cordova.apache.org/docs/en/3.0.0/cordova/file/file.html
Upvotes: 0