summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2021-01-28 15:48:53 -0500
committerAdam T. Carpenter <atc@53hor.net>2021-01-28 15:48:53 -0500
commit639c9516e22ad7db0af6ed274283112cc8fbfd79 (patch)
treeeaf5a8736839677c761262ed21b7b142ea510d35
parent5ed37a2015f404e623c2d3be53374ffa7875e432 (diff)
download53hor-639c9516e22ad7db0af6ed274283112cc8fbfd79.tar.xz
53hor-639c9516e22ad7db0af6ed274283112cc8fbfd79.zip
fixed indents
-rw-r--r--posts/programming/2021-01-28-undefined-javasript-is-undefined-.html10
1 files changed, 6 insertions, 4 deletions
diff --git a/posts/programming/2021-01-28-undefined-javasript-is-undefined-.html b/posts/programming/2021-01-28-undefined-javasript-is-undefined-.html
index 8ff3e7c..d4b8f11 100644
--- a/posts/programming/2021-01-28-undefined-javasript-is-undefined-.html
+++ b/posts/programming/2021-01-28-undefined-javasript-is-undefined-.html
@@ -97,7 +97,8 @@
<p>
You can see what the debugging logs looked like on the backend below.
Note that the <code>&data</code> is the field that spells out
- "undefined".
+ "undefined". Also note that the file picker/FormData was constructed
+ alright because the key for the image name is correct.
</p>
<pre>
@@ -136,16 +137,17 @@ ImageWrite("The image format could not be determined")
<code>
let file = event.target.files[0];
if (!file) {
-return;
+ return;
}
const fd = new FormData();
fd.append(file.name, file);
const response = await fetch("http://localhost:8000/photos", {
-method: "POST",
-body: fd
+ method: "POST",
+ body: fd
});
+
console.log(response);
</code>
</pre>