Signed-off-by: Jerome Jutteau <mojo@couak.net>
else
header ('Content-Disposition: filename="' . $link['file_name'] . '"');
header ('Content-Type: ' . $link['mime_type']);
+header ('Content-MD5: ' . hex_to_base64($link['md5']));
/* Read encrypted file. */
if ($link['crypted'])
}
return $_SERVER['REMOTE_ADDR'];
}
+
+/**
+ * Convert hexadecimal string to base64
+ */
+function hex_to_base64($hex)
+{
+ $b = '';
+ foreach (str_split ($hex, 2) as $pair)
+ $b .= chr (hexdec ($pair));
+ return base64_encode ($b);
+}