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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
570
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
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
180
OTP を自動で入力する裏技
megabitsenmzq
0
130
AI-DLC 入門 〜AIコーディングの本質は「コード」ではなく「構造」〜 / Introduction to AI-DLC: The Essence of AI Coding Is Not “Code” but “Structure”
seike460
PRO
0
130
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.4k
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
160
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
1.2k
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
450
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
270
Rethinking API Platform Filters
vinceamstoutz
0
4.3k
KagglerがMixSeekを触ってみた
morim
0
360
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.2k
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
160
Featured
See All Featured
The untapped power of vector embeddings
frankvandijk
2
1.6k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.5k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Mobile First: as difficult as doing things right
swwweet
225
10k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
240
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
110
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
500
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: 測試看看