How to use php to protect images and video browsers to display an image can be written as follows: <imgsrc="xxx.jpg & quot; & gt; & lt;/img>anyone who inputs xxx.jpg in the browser can browse this image, however, I want only the uploader to see this picture, which is invisible to others. My idea is to write: & l how to use php to protect pictures and videos
If the browser wants to display an image, you can write as follows:
Anyone who inputs xxx.jpg in the browser can browse this image, but I want this image to be visible only to the uploader and others.
My idea is to write:
Then fwrite, but this way the uploader cannot cache the image while browsing the image. Moreover, if it is a video file, fopen and fwrite have a high overhead on the server, how can we implement this simple function? Thank you!
------ Solution --------------------
Since picture. php can be judged, that is, it can also be determined in your real list.
Then, you can determine on the list page that only displays the video of the author.
------ Solution --------------------
. Php ?...... Read the image content, which can be cached.
As for video files, we should extend the php execution time .... As a media server, you need to worry more about bandwidth.
------ Solution --------------------
Is it me that I will not give the img path?
Determine whether the IMG label outputs a normal path if it is a user (login), not the default output path?
The server is under heavy pressure.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service