annotate src/test/upload.html @ 39:3354d4ac89f8

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 15 Aug 2022 13:49:57 -0600
parents 1ce75c5ab0f7
children 1ac7aee13eca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 <!doctype html>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 <html>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 <head>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4 <meta name="viewport" content="width=device-width, initial-scale=1">
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 <style>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 @import "/site.css";
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 </style>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 <script src="/site.js"></script>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 <script>
35
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
10 function uploaded(input,url,filename) {
34
c8d47981c74f upload using ajax
Franklin Schmidt <fschmidt@gmail.com>
parents: 33
diff changeset
11 console.log(url);
c8d47981c74f upload using ajax
Franklin Schmidt <fschmidt@gmail.com>
parents: 33
diff changeset
12 let a = document.querySelector('a');
c8d47981c74f upload using ajax
Franklin Schmidt <fschmidt@gmail.com>
parents: 33
diff changeset
13 a.textContent = filename;
c8d47981c74f upload using ajax
Franklin Schmidt <fschmidt@gmail.com>
parents: 33
diff changeset
14 a.setAttribute('href',url);
33
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 }
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 </script>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 </head>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 <body>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 <div content>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 <p>top</p>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21 <p>
34
c8d47981c74f upload using ajax
Franklin Schmidt <fschmidt@gmail.com>
parents: 33
diff changeset
22 <input type=file xaccept="image/*" onchange="upload(this,uploaded)">
c8d47981c74f upload using ajax
Franklin Schmidt <fschmidt@gmail.com>
parents: 33
diff changeset
23 <button onclick="fileButtonClick(this)">Upload File</button>
33
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24 </p>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25 <p><a></a></p>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 <p>bottom</p>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
27 </div>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
28 </body>
4fdc4ec0050b upload with uploadcare
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
29 </html>