Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
NTU CCSP 2012Fall - Node.js #2.1 - Simple File ...
Search
Steven Su
October 31, 2012
Programming
460
2
Share
NTU CCSP 2012Fall - Node.js #2.1 - Simple File Host Service
node.js 0.8 + express 3
Steven Su
October 31, 2012
More Decks by Steven Su
See All by Steven Su
JSDC.TW 2013 Node.js佈署心得
xpsteven
14
1.2k
NTU CCSP 2012Fall - Mobile Web入門 回首網頁開發
xpsteven
3
300
NTU CCSP 2012Fall - Facebook
xpsteven
1
210
NTU CCSP 2012Fall - Node.js #3 - Mongoose
xpsteven
2
730
NTU CCSP 2012Fall - Node.js #2 - express.js
xpsteven
3
580
Y! Open Hack 2012 Taiwan
xpsteven
0
190
NTU CCSP 2012Fall - Node.js #2 - Advanced Javascript and Node.js
xpsteven
1
550
Other Decks in Programming
See All in Programming
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
120
Kingdom of the Machine
yui_knk
2
330
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
140
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
250
Alternatives to JPA 2026
debop
0
110
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
130
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
220
2026_04_15_量子計算をパズルとして解く
hideakitakechi
0
110
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
3
310
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
16
5.6k
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
340
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
180
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
130
A designer walks into a library…
pauljervisheath
211
24k
The untapped power of vector embeddings
frankvandijk
2
1.7k
[SF Ruby Conf 2025] Rails X
palkan
2
960
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.6k
Un-Boring Meetings
codingconduct
0
270
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
220
Designing for Performance
lara
611
70k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
320
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
510
Transcript
簡易檔案上傳網站
目標 • 可以上傳檔案並給名稱 • 可以清單顯示已經上傳的檔案 • 可以顯示已經上傳的檔案
環境 • Windows 7 • Sublime Text 2 • Node.js
0.8.x • Express.js 3.0
要求 • 安裝好node 0.8.x • 可以使用npm指令 • 可以使用node指令
Step 0: 安裝express 打開終端機 輸入 npm install express –g -g也可以放install前面
-g代表安裝到global 才可以在任何資料夾當作指 令來使用 簡單說就是安裝程式到系統
Step 0: 安裝express
Step 1: 建立專案 測試express指令
Step 1: 建立專案 express -e -c less -s uploadserver
Step 2: 安裝所需要的庫 npm install 會自動依照目錄下 的package.json安裝所依賴的 套件到目前目錄(local mode)
Step 3: 驗證安裝 node app.js 打開瀏覽器 http://localhost:3000/
Step 4: 打開ST2 以資料夾模式開啟
Step 5: 編輯bodyParser 修改bodyParser keepExtensions => 保留附檔名 uploadDir => 指定上傳到哪個資料夾
Step 6: 接受上傳 var database 模擬一個資料庫 res.redirect(路徑) 回傳302導向其他 網頁
Step 7: 修改index view
Step 8: 測試看看吧
Step 9: 修改index的handler
Step 10: 再修改index.ejs
Step 11: 測試看看