का उपयोग कर का उपयोग करके फ़ाइलें, Phonegap का उपयोग कर [कॉर्डोबा 1.7.0]। मैं कैसे फ़ाइलों तक पहुँचने और फोन अंतराल के API Documentation पर उन्हें पढ़ने के लिए पढ़ें। लेकिन मुझे नहीं पता, जब फ़ाइल पढ़ी जाती है तो यह कहां लिखा जाएगा? & मैं आईफोन स्क्रीन पर पाठ, छवि, या जो कुछ भी टेक्स्ट रख रहा हूं उसे आउटपुट कैसे कर सकता हूं?पहुँच मैं आईओएस पर फाइलों के साथ काम करने के लिए कोशिश कर रहा हूँ Phonegap
यहाँ कोड मैं का उपयोग कर रहा है:
function onDeviceReady() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
}
function gotFS(fileSystem) {
fileSystem.root.getFile("readme.txt", null, gotFileEntry, fail);
}
function gotFileEntry(fileEntry) {
fileEntry.file(gotFile, fail);
}
function gotFile(file){
readDataUrl(file);
readAsText(file);
}
function readDataUrl(file) {
var reader = new FileReader();
reader.onloadend = function(evt) {
console.log("Read as data URL");
console.log(evt.target.result);
};
reader.readAsDataURL(file);
}
function readAsText(file) {
var reader = new FileReader();
reader.onloadend = function(evt) {
console.log("Read as text");
console.log(evt.target.result);
};
reader.readAsText(file);
}
function fail(evt) {
console.log(evt.target.error.code);
}
मैं फ़ाइल मैं पढ़ना चाहते हैं कहाँ निर्दिष्ट करूँ? – donkey
+1 मैं फ़ाइल कहां निर्दिष्ट करूं? –
@john_cat और oasisweng: मैं एक उदाहरण मैं पतों लगता है कि अपने प्रश्न के साथ एक टिप्पणी जोड़ दिया है। HTH! – sherb