質問編集履歴
5
エラー文追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -144,7 +144,15 @@
|
|
144
144
|
|
145
145
|
|
146
146
|
|
147
|
-
参考元のサイトのコードに即して書き直してみました。すると
|
147
|
+
参考元のサイトのコードに即して書き直してみました。すると、
|
148
|
+
|
149
|
+
> Error in Success callbackid:File870964021:
|
150
|
+
|
151
|
+
> ReferenceError:Can't find variable:fs
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
とエラーになります。fsはおそらくFileSystemのことではないかと思うのですが、参考元サイトのコードそのままの部分なので、どのようにエラー対処していいものか見当が付きません。ちなみにfsをfileSystemに書き換えても同様のエラーになります。よろしくお願いいたします。
|
148
156
|
|
149
157
|
|
150
158
|
|
4
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -56,9 +56,9 @@
|
|
56
56
|
|
57
57
|
```
|
58
58
|
|
59
|
+
---
|
59
60
|
|
60
|
-
|
61
|
-
追記:
|
61
|
+
**追記:**
|
62
62
|
|
63
63
|
参照元サイトで「FileEntry」を使用していることから、もしかすると下記のようなコードが参考になるかも知れません。
|
64
64
|
|
@@ -124,7 +124,7 @@
|
|
124
124
|
|
125
125
|
---
|
126
126
|
|
127
|
-
再追記:
|
127
|
+
**再追記:**
|
128
128
|
|
129
129
|
エラーメッセージです。
|
130
130
|
|
@@ -140,7 +140,9 @@
|
|
140
140
|
|
141
141
|
|
142
142
|
|
143
|
-
再追記(2017.10.21)
|
143
|
+
**再追記(2017.10.21)**
|
144
|
+
|
145
|
+
|
144
146
|
|
145
147
|
参考元のサイトのコードに即して書き直してみました。すると「ReferenceError:Can't find variable:fs」とエラーになります。fsはおそらくFileSystemのことではないかと思うのですが、参考元サイトのコードそのままの部分なので、どのようにエラー対処していいものか見当が付きません。ちなみにfsをfileSystemに書き換えても同様のエラーになります。よろしくお願いいたします。
|
146
148
|
|
3
新しいコードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -122,6 +122,8 @@
|
|
122
122
|
|
123
123
|
```
|
124
124
|
|
125
|
+
---
|
126
|
+
|
125
127
|
再追記:
|
126
128
|
|
127
129
|
エラーメッセージです。
|
@@ -131,3 +133,55 @@
|
|
131
133
|
|
132
134
|
|
133
135
|
> TypeError: directoryReader.move is not a function. (In 'directoryReader.move(fileName, '/' + folderB + '/')', 'directoryReader.move' is undefined)
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
---
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
再追記(2017.10.21)
|
144
|
+
|
145
|
+
参考元のサイトのコードに即して書き直してみました。すると「ReferenceError:Can't find variable:fs」とエラーになります。fsはおそらくFileSystemのことではないかと思うのですが、参考元サイトのコードそのままの部分なので、どのようにエラー対処していいものか見当が付きません。ちなみにfsをfileSystemに書き換えても同様のエラーになります。よろしくお願いいたします。
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
```JavaScript
|
150
|
+
|
151
|
+
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fs) {
|
152
|
+
|
153
|
+
move('/' + folderA + '/' + 'abc.jpg', folderB + '/');
|
154
|
+
|
155
|
+
}, errorHandler);
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
function move(src, dirName) {
|
160
|
+
|
161
|
+
fs.root.getFile(src, {}, function(fileEntry) {
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
fs.root.getDirectory(dirName, {}, function(dirEntry) {
|
166
|
+
|
167
|
+
fileEntry.moveTo(dirEntry);
|
168
|
+
|
169
|
+
}, errorHandler);
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
}, errorHandler);
|
174
|
+
|
175
|
+
}
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
function errorHandler(e) {
|
182
|
+
|
183
|
+
console.log('Error: ' + msg);
|
184
|
+
|
185
|
+
}
|
186
|
+
|
187
|
+
```
|
2
エラーメッセージを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -121,3 +121,13 @@
|
|
121
121
|
);
|
122
122
|
|
123
123
|
```
|
124
|
+
|
125
|
+
再追記:
|
126
|
+
|
127
|
+
エラーメッセージです。
|
128
|
+
|
129
|
+
> Error in Success callbackId: File1535706521 : TypeError: directoryReader.move is not a function. (In 'directoryReader.move(fileName, '/' + folderB + '/')', 'directoryReader.move' is undefined)
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
> TypeError: directoryReader.move is not a function. (In 'directoryReader.move(fileName, '/' + folderB + '/')', 'directoryReader.move' is undefined)
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -55,3 +55,69 @@
|
|
55
55
|
}
|
56
56
|
|
57
57
|
```
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
追記:
|
62
|
+
|
63
|
+
参照元サイトで「FileEntry」を使用していることから、もしかすると下記のようなコードが参考になるかも知れません。
|
64
|
+
|
65
|
+
```JavaScript
|
66
|
+
|
67
|
+
var filename = 'abc.jpg';
|
68
|
+
|
69
|
+
var folderurl = cordova.file.documentsDirectory + 'folderA' + '/';
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
window.resolveLocalFileSystemURL( folderurl ,
|
74
|
+
|
75
|
+
function getDirectoryEntry( directoryEntry ) {
|
76
|
+
|
77
|
+
directoryEntry.getFile( filename, null,
|
78
|
+
|
79
|
+
function readFile( fileEntry ) {
|
80
|
+
|
81
|
+
fileEntry.file(
|
82
|
+
|
83
|
+
function( file ) {
|
84
|
+
|
85
|
+
var reader = new FileReader();
|
86
|
+
|
87
|
+
reader.onloadend = function() {
|
88
|
+
|
89
|
+
};
|
90
|
+
|
91
|
+
reader.readAsText(file);
|
92
|
+
|
93
|
+
},
|
94
|
+
|
95
|
+
function fail(e) {
|
96
|
+
|
97
|
+
// エラー処理
|
98
|
+
|
99
|
+
}
|
100
|
+
|
101
|
+
);
|
102
|
+
|
103
|
+
},
|
104
|
+
|
105
|
+
function fail(e) {
|
106
|
+
|
107
|
+
// エラー処理
|
108
|
+
|
109
|
+
}
|
110
|
+
|
111
|
+
);
|
112
|
+
|
113
|
+
},
|
114
|
+
|
115
|
+
function fail(e) {
|
116
|
+
|
117
|
+
// エラー処理
|
118
|
+
|
119
|
+
}
|
120
|
+
|
121
|
+
);
|
122
|
+
|
123
|
+
```
|