I have a simple file host that gives the files a unique identifier and just saves them in a directory. I was told that this will cause problems in the future, and I wonder what I should look for to make sure that it works smoothly in the future and beyond.
Also, is there a performance issue when forcing downloads by sending header information and readfile ()? Would it be better to save the file names and allow the use of direct download not to use a script?
thanks
, , readfile()?
, . script :
- , - (, , C , , ), .
script?
, , - . . .
, URL- :
hxxp://www.example.com/files/1234/Lovely_long_filename_that_can_contain_any_Unicode_character.zip
:
hxxp://www.example.com/realfiles/1234.dat
() -.
, , , .
, , ().
, ID (, 19873) , , <uploads>/73/98/19873_<filename.ext>, 73 - ID % 100, 98 - (ID / 100) % 100 ..
<uploads>/73/98/19873_<filename.ext>
ID % 100
(ID / 100) % 100
, <uploads> 100 100 <uploads>/*. .
<uploads>
<uploads>/*
, inodes ( , ), , ext3, ) ( , 20 , ). (10, 1000) 100. 100 100 . 5 .
ext3
, , .
. ext3 - .
-, , , ARG_MAX. , rm -rf * . , A-Z/a-z .
, , ... crons like 'updatedb' , . , "".
- . ? 300 , 30 ? , , , /proc/sys/vfs _cache_pressure, Linux PHP/Apache/Etc.
, readfile... . PHP .
, .
, , , , . .
I believe that I suggest using a script to control abuse. I also suggest saving file names if your script does not create an index in the database with respect to it in its original state. You can also try to make a script with some Rewrite magic on this, thereby creating another level of security without exposing the real name (your unique identifier) to the end user.
Source: https://habr.com/ru/post/1704247/More articles:Оператор точки в Objective-C 2.0 - iosOracle performance schema changes compared to MySQL ALTER TABLE? - oracleASP.net website. The assembly includes pdb files. How can I get rid of them? - asp.netКак вы определяете блок кода один раз для многократного использования? - rubyCosts associated with C # destructors (aka: finalizers)? - c #Can I create ToolStripMenuItem using TextBox and Label? - user-interfaceTomcat service: quotes in wrapper.conf file - javaCan Flex / Flash record a screen? - flexSetting the AVAudioPlayer volume to the user's ringer volume? - iphoneto write a batch file to delete folders by date and time - scriptingAll Articles