T
T
tmtimuchin2019-11-12 15:04:13
PHP
tmtimuchin, 2019-11-12 15:04:13

How to add several files (jpeg, png) to the server at once?

I need to write a website where each entry / post contains several pictures. Their number is not defined, maybe 2-3, maybe 50 at once. The question is: how to organize their storage in the database, reading from the database, and maybe adding (although I don’t think that this can cause problems if I'll deal with the rest). That is, if the post contained only one image, there would be no questions: in addition to the post id, title, and other things, the entry in the database should also have a field with a link to the file. There are several files at once, and do not add them all in one field. Can I make a separate table with photos and link it to the post by id?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Antony Tkachenko, 2018-10-23
@LemonFox

1) exec / shell_exec / ... php.net/manual/ru/ref.exec.php
2) php.net/manual/ru/book.curl.php
https://incarnate.github.io/curl-to -php/

R
Ruslan., 2019-11-12
@tmtimuchin

It is better not to store image files in the database, but to store the association of the post identifier with the file path to the image in the database.
And the pictures themselves are stored on a separate file server.
So it will be easier / faster to give them away.

F
FanatPHP, 2019-11-12
@FanatPHP

I will tell you a secret.
A magical genie lives in your computer.
You just have to tell him your desire, and bam - he will immediately give a million answers.
The desire must be written in the address bar of your browser.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question