Skip to content

Commit 384c39b

Browse files
save file
1 parent 4e7088e commit 384c39b

File tree

1 file changed

+130
-0
lines changed

1 file changed

+130
-0
lines changed
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
2+
3+
4+
<!DOCTYPE html>
5+
6+
<html lang=en>
7+
8+
<head>
9+
<meta charset=utf-8>
10+
11+
<title>
12+
file-server
13+
</title>
14+
15+
16+
<script src='https://libs.ext-code.com/js/dom/component/component.js'></script>
17+
<script src='https://libs.ext-code.com/js/dom/init-hdr/init-hdr.js'></script>
18+
19+
<script>
20+
21+
22+
</script>
23+
24+
<style>
25+
26+
html
27+
{font-family:arial}
28+
29+
30+
#hdr
31+
{display:flex;justify-content:space-between}
32+
33+
code
34+
{display:block;white-space:pre;font-family:monospace;margin:20px;padding:20px;background:whitesmoke}
35+
36+
37+
</style>
38+
39+
</head>
40+
41+
42+
<body>
43+
44+
45+
<div id=hdr>
46+
47+
<div>
48+
<a href='https://ext-code.com/'>
49+
home
50+
</a>
51+
52+
<a href='../../../code.html'>
53+
code
54+
</a>
55+
</div>
56+
57+
<h1>
58+
file-server
59+
</h1>
60+
61+
<div>
62+
19 Dec 2025
63+
</div>
64+
65+
</div hdr>
66+
67+
68+
<div>
69+
70+
71+
<p>
72+
This code module implements a lightweight HTTPS server that exposes direct file system operations to the browser through a simple fetch‑based API. By sending requests such as
73+
</p>
74+
75+
<code>
76+
77+
fetch("https://localhost:3000/a.txt", { headers: { mode: "load" } })
78+
79+
</code>
80+
81+
<p>
82+
the browser can interact with local files securely and consistently.
83+
</p>
84+
85+
<p>
86+
Supported operations include:
87+
</p>
88+
89+
<p>
90+
load → retrieve file contents
91+
</p>
92+
93+
<p>
94+
save → write or overwrite file data
95+
</p>
96+
97+
<p>
98+
file delete → remove a file
99+
</p>
100+
101+
<p>
102+
dir read → list directory contents
103+
</p>
104+
105+
<p>
106+
dir create → make a new directory
107+
</p>
108+
109+
<p>
110+
dir delete → remove a directory
111+
</p>
112+
113+
<p>
114+
Together, these commands provide a complete set of standard file I/O capabilities accessible from the browser. This member sits at the Code stage of the pipeline: more substantial than a library, since it defines a working server with a defined protocol, but not yet a full project. It serves as a foundation for building browser‑driven file management tools, developer utilities, or experimental web‑native applications.
115+
</p>
116+
117+
118+
</body>
119+
120+
<script>
121+
122+
123+
</script>
124+
125+
</html>
126+
127+
128+
129+
130+

0 commit comments

Comments
 (0)