我该如何存储我的用户图像? [关闭]

I've been reviewing all sorts of ways and researching, but I haven't been able to find solutions. Should I store them in my host's database, my filesystem, or through a third party? If through a third party, which one? Imgur, AWS S3, etc?

The best way is to store the images' location on the database and then link it via PHP or ASP from some protected directory.

Example (when you are saving picture name and extension with extension):

Query to select all data:

PHP:

{ $profile_picture = $row['pictureLocation']; }

Then wrapping around the path to directory:

$profile_picture = "../assets/protected/images/users/" . $profile_picture ;

HTML:

<img src="<?php echo $profile_picture ; ?>" >

Usually the easiest way (space allowing) is to simply store the actual picture file in your filesystem. Then, in order to reference the file, store the file path in a MySQL database. With that said, there are many ways to store pictures and the best is to experiment with them.