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
Protecting static files in your web app
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Max Ludwig
January 02, 2016
Programming
0
500
Protecting static files in your web app
... in production
https://github.com/dAnjou/xsendfile-example
Max Ludwig
January 02, 2016
Tweet
Share
Other Decks in Programming
See All in Programming
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6.1k
AI & Enginnering
codelynx
0
110
24時間止められないシステムを守る-医療ITにおけるランサムウェア対策の実際
koukimiura
1
100
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.5k
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
180
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
980
Package Management Learnings from Homebrew
mikemcquaid
0
230
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
2.6k
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
83
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
A better future with KSS
kneath
240
18k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
How to make the Groovebox
asonas
2
1.9k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
350
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
37k
Crafting Experiences
bethany
1
49
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
100
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
320
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.5k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
93
Transcript
… in production Protecting static files in your web app
X-Sendfile HTTP header
GET /video.ogv video.ogv web server web app check permissions +
set header check header + serve file
from django.http import HttpResponse from django.utils.encoding import smart_str def sendfile(request,
filename, **kwargs): # check requesting user’s permissions response = HttpResponse() response['X-Sendfile'] = smart_str(unicode(filename)) return response django-sendfile/sendfile/backends/xsendfile.py
<VirtualHost *:80> XSendFile On # ... </VirtualHost> /etc/apache2/sites-available/example.de
Apache2: X-Sendfile nginx: X-Accel-Redirect Lighttpd: X-LIGHTTPD-send-file
github.com/dAnjou/xsendfile-example
[email protected]