WP8 प्लेटफ़ॉर्म के साथ कॉर्डोवा फ़ाइल प्लगइन का उपयोग करने के तरीके पर दस्तावेज़ों की गंभीर कमी है।WP8/कॉर्डोवा फाइल सिस्टम - क्या कोई सही कोड जानता है?
मैं एंड्रॉयड, fireOS और iOS पर कोई ऐप्लिकेशन मिल गया है, सभी, मेरे वेब सेवा है जो सभी का उपयोग निम्न कोड से उत्पन्न फ़ाइलों निर्देशिका सामग्री, डाउनलोड देखने बचाने के लिए और खोलने के लिए फ़ाइल प्लगइन का उपयोग कर:
function listDir() {
//console.log('listDir');
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
function gotFS(fileSystem) {
//console.log('gotFS. filesystem.root = ' + fileSystem.root.value);
fileSystem.root.getDirectory("MyFolder", { create: true, exclusive: false }, gotDir);
}
function gotDir(dirEntry) {
//console.log('gotDir');
// Get a directory reader
var directoryReader = dirEntry.createReader();
// Get a list of all the entries in the directory
directoryReader.readEntries(success, fail);
}
function success(entries) {
var i = 0, sb = '';
sb += '<ul data-role="listview" data-inset="true" id="pdfFiles">';
if (entries.length > 0) {
for (i = 0; i < entries.length; i++) {
sb += '<li><a href="#" data-src="' + entries[i].toURL() + '"><img src="images/icons/icon_pdf.png" class="ui-li-icon" width="16px" height="16px" alt="PDF Icon" />';
sb += entries[i].name;
//sb += '<br />';
//sb += entries[i].fullPath;
sb += '</a></li>';
}
} else {
sb += '<li><p>You do not have any saved reports</p></li>';
}
sb += '</ul>';
$('#pdfReports-entries').html(sb);
$('ul#pdfFiles').listview().listview('refresh');
//open the pdf file using the fileOpener plugin
$('ul#pdfFiles li a').on('click', function() {
$this = $(this);
window.plugins.fileOpener.open($this.attr('data-src'));
});
}
function fail(error) {
logError("Failed to list directory contents: " + error.code);
sb += '<ul data-role="listview" data-inset="true" id="pdfFiles">';
sb += '<li><p>You do not have any saved reports</p></li>';
sb += '</ul>';
$('#pdfReports-entries').html(sb);
$('ul#pdfFiles').listview().listview('refresh');
}
A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll
मैं तो this Github में कोड की कोशिश की, जो अभी भी विफल रहा है:
}
WP8 gotFS समारोह में निम्न त्रुटि फेंकता किसी भी निर्देशिका को बनाने या पढ़ने के लिए, लेकिन IsolatedStorageException अपवाद फेंक नहीं दिया।
मैंने कई बार Google से पूछा है, लेकिन यह एक सुसंगत उत्तर देने में असमर्थ है।
कोई भी जानता है कि WP8 के साथ फ़ाइल प्लगइन का उपयोग कैसे करें?
आपको "+1 दस्तावेज की गंभीर कमी" पर मेरा +1 वोट मिला है :) बस एक अनुमान है, लेकिन क्या आपने फ़ाइल सिस्टम तक पहुंचने के लिए अपनी ऐप अनुमतियां देना सुनिश्चित किया है? – CodingWithSpike
आपका प्रश्न बिल्कुल मेरे बिंदु को दिखाता है! मैं कहां/कैसे जांचूं या सक्षम करूं? – DaveSav
मैंने कोशिश की लेकिन 'fileSystem.root.value'' अपरिभाषित 'है। क्या यह केवल डिवाइस पर काम करता है, न कि एक एमुलेटर पर? – Sumit