<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 02.08.2012 17:05, Emre Erenoglu
wrote:<br>
</div>
<blockquote
cite="mid:CAF2-kRiTjnw8H5APg80bvWnOrV8otj6T-eQ47+qNpg1L+DR9PA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_quote">For MD5SUM, a stupid question if I may
ask, could the md5sum or any other checksum/hash be generated
"on the fly" while the file is uploaded from sync client, web
interface or webdav? This way, we don't need to spend
additional IO cycles to upload and then hash. :)</div>
</div>
</blockquote>
I alway wanted to look this up. It seems that instead of using
move_uploaded_file it is preferable to user fopen('php://input') to
do fileuploads[1]:<br>
<br>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<span class="default" style="color: rgb(0, 0, 187);
background-color: rgb(240, 240, 240); font-family: Consolas,
'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco,
'Courier New', Courier, monospace; font-size: 14px; font-style:
normal; font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: 2; text-align: left;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; "><?php<br>
<br>
</span><span class="keyword" style="color: rgb(0, 119, 0);
background-color: rgb(240, 240, 240); font-family: Consolas,
'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco,
'Courier New', Courier, monospace; font-size: 14px; font-style:
normal; font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: 2; text-align: left;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">if (</span><span class="default"
style="color: rgb(0, 0, 187); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">$_SERVER</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">[</span><span class="string"
style="color: rgb(221, 0, 0); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">'REQUEST_METHOD'</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">] ==<span
class="Apple-converted-space"> </span></span><span
class="string" style="color: rgb(221, 0, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">"PUT"</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">)<br>
{<span class="Apple-converted-space"> </span></span><span
class="default" style="color: rgb(0, 0, 187); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">$f<span
class="Apple-converted-space"> </span></span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">=<span
class="Apple-converted-space"> </span></span><span
class="default" style="color: rgb(0, 0, 187); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">fopen</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">(</span><span class="default"
style="color: rgb(0, 0, 187); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">basename</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">(</span><span class="default"
style="color: rgb(0, 0, 187); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">$_SERVER</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">[</span><span class="string"
style="color: rgb(221, 0, 0); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">'REQUEST_URI'</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">]),<span
class="Apple-converted-space"> </span></span><span
class="string" style="color: rgb(221, 0, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">"w"</span><span class="keyword"
style="color: rgb(0, 119, 0); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">);<br>
<span class="Apple-converted-space"> </span></span><span
class="default" style="color: rgb(0, 0, 187); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">$s<span
class="Apple-converted-space"> </span></span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">=<span
class="Apple-converted-space"> </span></span><span
class="default" style="color: rgb(0, 0, 187); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">fopen</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">(</span><span class="string"
style="color: rgb(221, 0, 0); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">"php://input"</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">,<span
class="Apple-converted-space"> </span></span><span
class="string" style="color: rgb(221, 0, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">"r"</span><span class="keyword"
style="color: rgb(0, 119, 0); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">);<br>
while(</span><span class="default" style="color: rgb(0, 0, 187);
background-color: rgb(240, 240, 240); font-family: Consolas,
'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco,
'Courier New', Courier, monospace; font-size: 14px; font-style:
normal; font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: 2; text-align: left;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">$kb<span
class="Apple-converted-space"> </span></span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">=<span
class="Apple-converted-space"> </span></span><span
class="default" style="color: rgb(0, 0, 187); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">fread</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">(</span><span class="default"
style="color: rgb(0, 0, 187); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">$s</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">,<span
class="Apple-converted-space"> </span></span><span
class="default" style="color: rgb(0, 0, 187); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">1024</span><span class="keyword"
style="color: rgb(0, 119, 0); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">))<br>
{<span class="Apple-converted-space"> </span></span><span
class="default" style="color: rgb(0, 0, 187); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">fwrite</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">(</span><span class="default"
style="color: rgb(0, 0, 187); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">$f</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">,<span
class="Apple-converted-space"> </span></span><span
class="default" style="color: rgb(0, 0, 187); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">$kb</span><span class="keyword"
style="color: rgb(0, 119, 0); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">,<span
class="Apple-converted-space"> </span></span><span
class="default" style="color: rgb(0, 0, 187); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">1024</span><span class="keyword"
style="color: rgb(0, 119, 0); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">);
}<br>
<span class="Apple-converted-space"> </span></span><span
class="default" style="color: rgb(0, 0, 187); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">fclose</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">(</span><span class="default"
style="color: rgb(0, 0, 187); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">$f</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">);<br>
<span class="Apple-converted-space"> </span></span><span
class="default" style="color: rgb(0, 0, 187); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">fclose</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">(</span><span class="default"
style="color: rgb(0, 0, 187); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">$s</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">);<br>
<span class="Apple-converted-space"> </span></span><span
class="default" style="color: rgb(0, 0, 187); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">Header</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">(</span><span class="string"
style="color: rgb(221, 0, 0); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">"HTTP/1.1
201 Created"</span><span class="keyword" style="color: rgb(0, 119,
0); background-color: rgb(240, 240, 240); font-family: Consolas,
'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco,
'Courier New', Courier, monospace; font-size: 14px; font-style:
normal; font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: 2; text-align: left;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">); }<br>
elseif (</span><span class="default" style="color: rgb(0, 0, 187);
background-color: rgb(240, 240, 240); font-family: Consolas,
'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco,
'Courier New', Courier, monospace; font-size: 14px; font-style:
normal; font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: 2; text-align: left;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">$_SERVER</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">[</span><span class="string"
style="color: rgb(221, 0, 0); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">'REQUEST_METHOD'</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">] ==<span
class="Apple-converted-space"> </span></span><span
class="string" style="color: rgb(221, 0, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">"GET"</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">)<br>
{<span class="Apple-converted-space"> </span></span><span
class="default" style="color: rgb(0, 0, 187); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">readfile</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">(</span><span class="default"
style="color: rgb(0, 0, 187); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">basename</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">(</span><span class="default"
style="color: rgb(0, 0, 187); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">$_SERVER</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">[</span><span class="string"
style="color: rgb(221, 0, 0); background-color: rgb(240, 240,
240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono',
'Lucida Console', Monaco, 'Courier New', Courier, monospace;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">'REQUEST_URI'</span><span
class="keyword" style="color: rgb(0, 119, 0); background-color:
rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier,
monospace; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">])); }<br>
<br>
</span><span class="default" style="color: rgb(0, 0, 187);
background-color: rgb(240, 240, 240); font-family: Consolas,
'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco,
'Courier New', Courier, monospace; font-size: 14px; font-style:
normal; font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: 2; text-align: left;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">?></span><br>
<br>
In a ddition to saving the buffer to a file we could use hash_init,
hash_update and hash_final to create a hash for it without reading
the whole thing again. This would also allow us to save the file
directly to the location we want, without copying it when calling
OC_Helper::streamCopy(), which should by the way use
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
stream_copy_to_stream instead of reimplementing it, right?<br>
<br>
seems nice, wanna implement it?<br>
<br>
<br>
so long<br>
<br>
Jörn<br>
<br>
[1] src:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<a
href="http://php.net/manual/de/features.file-upload.put-method.php">http://php.net/manual/de/features.file-upload.put-method.php</a>
<pre class="moz-signature" cols="72">--
Jörn Friedrich Dreyer (<a class="moz-txt-link-abbreviated" href="mailto:jfd@owncloud.com">jfd@owncloud.com</a>)
Software Developer
ownCloud GmbH
Your Data, Your Cloud, Your Way!
ownCloud GmbH, GF: Markus Rex, Holger Dyroff
Schloßäckerstrasse 26a, 90443 Nürnberg, HRB 28050 (AG Nürnberg)</pre>
</body>
</html>