Answer the question
In order to leave comments, you need to log in
How to implement storage of pictures from the user on the server?
Interested in the approach in terms of security and performance.
At first I decided to do it like in VK, so that the address of the picture was something like:
"example.com/c637820/v637821842/115d2/imageName.jpg" I'm
interested here, what
does 1. c637820 mean exactly
2. v637821842
Where do these id come from?
I also really liked the implementation on Facebook,
there is generally access by a certain token in the get parameter of the picture:
"
example.com/v/t1.0-9/283048_103813746439563_31482813_n.jpg?oh=63f4724d166e6e322316283885f15ddc&oe=58D3C4F4"
code that is not safe.
Answer the question
In order to leave comments, you need to log in
from here
, if not in that article, then there is definitely a general principle on the site - md5 and folder distribution,
and if you want to burn VK, then yes, the last three digits match the numbers in the ID
Exhaustive answer
bablogon.net/view.php?p=151
In social networks, files are scattered across different servers and are also tied to a specific id, so their storage principle differs from a single-server implementation
It turns out that the pictures have access to the program code, which is not safe.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question