質問編集履歴
2
追加で確認したことの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -131,3 +131,113 @@
|
|
131
131
|
</html>
|
132
132
|
|
133
133
|
```
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
---
|
138
|
+
|
139
|
+
**追加で確認した内容**
|
140
|
+
|
141
|
+
const { Readable } = require('stream');で変換する方式ですが、中身が入っていない?ような気がしています。
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
```js
|
146
|
+
|
147
|
+
const imgdata = req.payload.img_file;
|
148
|
+
|
149
|
+
console.log(imgdata );
|
150
|
+
|
151
|
+
console.log("↑受け取ったデータ");
|
152
|
+
|
153
|
+
const { Readable } = require('stream');
|
154
|
+
|
155
|
+
const stream = Readable.from(imgdata);
|
156
|
+
|
157
|
+
console.log(stream);
|
158
|
+
|
159
|
+
```
|
160
|
+
|
161
|
+
返ってきた値
|
162
|
+
|
163
|
+
```log
|
164
|
+
|
165
|
+
<Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ff db 00 43 00 03 02 02 03 02 02 03 03 03 03 04 03 03 04 05 08 05 05 04 04 05 0a 07 07 06 ... 299480 more bytes>
|
166
|
+
|
167
|
+
↑受け取ったデータ
|
168
|
+
|
169
|
+
Readable {
|
170
|
+
|
171
|
+
_readableState: ReadableState {
|
172
|
+
|
173
|
+
objectMode: true,
|
174
|
+
|
175
|
+
highWaterMark: 16,
|
176
|
+
|
177
|
+
buffer: BufferList { head: null, tail: null, length: 0 },
|
178
|
+
|
179
|
+
length: 0,
|
180
|
+
|
181
|
+
pipes: [],
|
182
|
+
|
183
|
+
flowing: null,
|
184
|
+
|
185
|
+
ended: false,
|
186
|
+
|
187
|
+
endEmitted: false,
|
188
|
+
|
189
|
+
reading: false,
|
190
|
+
|
191
|
+
sync: true,
|
192
|
+
|
193
|
+
needReadable: false,
|
194
|
+
|
195
|
+
emittedReadable: false,
|
196
|
+
|
197
|
+
readableListening: false,
|
198
|
+
|
199
|
+
resumeScheduled: false,
|
200
|
+
|
201
|
+
errorEmitted: false,
|
202
|
+
|
203
|
+
emitClose: true,
|
204
|
+
|
205
|
+
autoDestroy: true,
|
206
|
+
|
207
|
+
destroyed: false,
|
208
|
+
|
209
|
+
errored: null,
|
210
|
+
|
211
|
+
closed: false,
|
212
|
+
|
213
|
+
closeEmitted: false,
|
214
|
+
|
215
|
+
defaultEncoding: 'utf8',
|
216
|
+
|
217
|
+
awaitDrainWriters: null,
|
218
|
+
|
219
|
+
multiAwaitDrain: false,
|
220
|
+
|
221
|
+
readingMore: false,
|
222
|
+
|
223
|
+
decoder: null,
|
224
|
+
|
225
|
+
encoding: null,
|
226
|
+
|
227
|
+
[Symbol(kPaused)]: null
|
228
|
+
|
229
|
+
},
|
230
|
+
|
231
|
+
_read: [Function: read],
|
232
|
+
|
233
|
+
_events: [Object: null prototype] {},
|
234
|
+
|
235
|
+
_eventsCount: 0,
|
236
|
+
|
237
|
+
_maxListeners: undefined,
|
238
|
+
|
239
|
+
[Symbol(kCapture)]: false
|
240
|
+
|
241
|
+
}
|
242
|
+
|
243
|
+
```
|
1
htmlのsourceを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -91,3 +91,43 @@
|
|
91
91
|
|
92
92
|
|
93
93
|
10時間以上この1点で止まってしまっているため、解決策に心当たりがある方はご教授願えないでしょうか。
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
追記 フォームは以下を利用しています。
|
100
|
+
|
101
|
+
```http
|
102
|
+
|
103
|
+
<!DOCTYPE html>
|
104
|
+
|
105
|
+
<html lang="ja">
|
106
|
+
|
107
|
+
<head>
|
108
|
+
|
109
|
+
<meta charset="UTF-8">
|
110
|
+
|
111
|
+
<title>File</title>
|
112
|
+
|
113
|
+
</head>
|
114
|
+
|
115
|
+
<body>
|
116
|
+
|
117
|
+
<form method="post" action="http://nodejsserver" enctype="multipart/form-data">
|
118
|
+
|
119
|
+
<input type="file" id="img_file" name="img_file">
|
120
|
+
|
121
|
+
<input type="submit" value="送信">
|
122
|
+
|
123
|
+
</form>
|
124
|
+
|
125
|
+
<p>
|
126
|
+
|
127
|
+
</p>
|
128
|
+
|
129
|
+
</body>
|
130
|
+
|
131
|
+
</html>
|
132
|
+
|
133
|
+
```
|