summaryrefslogtreecommitdiff
path: root/http/pic
diff options
context:
space:
mode:
Diffstat (limited to 'http/pic')
-rw-r--r--http/pic/.gitignore3
-rw-r--r--http/pic/.htaccess6
-rw-r--r--http/pic/fetch.php13
3 files changed, 22 insertions, 0 deletions
diff --git a/http/pic/.gitignore b/http/pic/.gitignore
new file mode 100644
index 0000000..ef5c65e
--- /dev/null
+++ b/http/pic/.gitignore
@@ -0,0 +1,3 @@
+*.jpg
+*.png
+*.gif
diff --git a/http/pic/.htaccess b/http/pic/.htaccess
new file mode 100644
index 0000000..615bc19
--- /dev/null
+++ b/http/pic/.htaccess
@@ -0,0 +1,6 @@
+RewriteEngine On
+
+RewriteCond %{SCRIPT_FILENAME} !-f
+RewriteCond %{SCRIPT_FILENAME} !-d
+RewriteRule .* fetch.php [QSA,L]
+
diff --git a/http/pic/fetch.php b/http/pic/fetch.php
new file mode 100644
index 0000000..1fb94cd
--- /dev/null
+++ b/http/pic/fetch.php
@@ -0,0 +1,13 @@
+<?php
+
+$resource = @file_get_contents('http://msc.com.pl/cezar' . $_SERVER['REQUEST_URI']);
+if ($resource) {
+ $filename = array_pop(explode('/', $_SERVER['REQUEST_URI']));
+ file_put_contents($filename, $resource);
+ foreach ($http_response_header as $header) {
+ header($header);
+ }
+ readfile($filename);
+}
+
+?>