Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
You can use hashing.
For example, SHA1("222.exe" + "key") = hash
"key" is some string that only the server knows.
The client says it wants /name=222.exe&hash=hash. If the hash on the server matches what the client sent, then it can download the file.
By what rule to issue keys to clients is up to you. For example, if you "mix" a session cookie into it, then another user will not be able to download the file.
1. You can put the file so that it is not visible to the web server at all. And give the file a script, checking, as you like, authorization, rights, and so on. For example the following application structure:
/webroot/getfile.php
/storage/
/storage/file1.jpg
/storage/file2.jpg
/storage/file3.jpg
<?php
$file = '../'.$_GET['file'];
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
?>
/webroot/getfile.php
/webroot/longlonglongname -> ../storage/file1.jpg
/storage/
/storage/file1.jpg
/storage/file2.jpg
/storage/file3.jpg
It is possible with a negative margin, but then you can catch incomprehensible spaces at the bottom. Try different ways. You can set translate to negative, you can set top to negative, while making both blocks relative and naturally set z-index for both, otherwise you will run into problems with browsers, some will display normally, and some will not (tested in very different conditions).
If the blue block has a fixed height, make it inside the black one and set it as it should be through absolute, and make a large padding for the black one, which will be the height to the very bottom of the blue one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question