V
V
veryoriginalnickname2021-04-20 21:19:38
JavaScript
veryoriginalnickname, 2021-04-20 21:19:38

Where to store media files for the site?

I'm making a website, and the question arose about where to store the files uploaded by me. All sorts of pictures, video, audio, everything will be shown to users when viewing the site.
At first I thought to store them in the same place where the site will be located, i.e. in the cloud server. But there is a small amount of storage. 50GB for 400 rubles is expensive and has little space, and is clearly designed for hosting a site, and not for storing any files. Plus, they write on the Internet that they can restrict access if they carry out a lot of manipulations with files.
Googled another option - S3 or Yandex.Cloud. Everything would be fine, a huge volume and all that.
But there are two problems:
1. They can automatically deduct money from the card, which is generally not normal. And that would be fine, but there is a second problem.
2. With these storages, the problem is in the distribution of files, and not in their size. As I understand it, if you make conditional 50 thousand GET requests, then they can easily write off the amount of money they need for these requests (and apparently it is impossible to set a limit on the number of requests). Or if there is no money on the card, then I will become it and owe it. What if someone writes software for fun that sends millions of GET requests to my site at night? Will I owe hundreds of thousands of rubles to S3 or Yandex? But after all, a bunch of sites distribute files in this way, so there is some way to do everything normally?
And there is another option: since the site is unlikely to be visited by many people, you can buy a cheap NAS, put it at home, and distribute files. But here, as I understand it, you need to get a static IP from the provider, and there are probably a lot of pitfalls.
In general, the question is: where and how can you normally store media files for the site?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
V
Vladislav Lyskov, 2018-08-02
@Vlatqa

the error is not in this code

S
SagePtr, 2018-08-02
@SagePtr

In 90% of cases, this "Unexpected token <" is a PHP error displayed on the screen, which by default is displayed in HTML format and starts with an opening tag (it is not valid JSON, so JS breaks off on it)

D
Dimonchik, 2021-04-20
@veryoriginalnickname

you all write correctly, you need to store files where it is cheap to store them: there are cheap storage plans
or change business

M
maksam07, 2021-04-20
@maksam07

https://vk.cc/c18lFJ

V
Vladislav Lyskov, 2021-04-20
@Vlatqa

What is the problem with storing files at home?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question