1

Topic: Operation with ways to photos without php and node.js on a hosting

All greetings. There will be a lot of text for the situation description smile
A question Essence, for those who does not want to read all text:
How to generate ways to present at a folder on the server apach files with unknown in advance names, without usage PHP, at once to use these ways for generation of tags img?
---
I have very much a brief experience in a web development on client side with usage html, css and other things which are launched on apache.
(Normally I take the server on which it is installed tomkat/glassfish and any DB, I saw application on Java with usage different  or on bare servlets and especially was not soared concerning questions of simple display of pictures with usage of ways to them which hranjatsja/are generated (we we admit through any kind ajax request) and are edited in a DB.)
But here there is at me a personal site which I want to rewrite on React JS and there there will be photos.
I would like them to add simply throwing in a folder on ftp.
But it is necessary for display of pictures already! To have ways to files. After all so?
Not a problem if files have names 1,2,3...999.jpg here it is possible javasript' to generate ways and accordingly tags img with these ways.
But what, if names of files are unknown and will be added through ftp?
PHP I do not know (well almost) and not especially would like it to study, simply there is no time.
The hosting the most normal for $2 a month, there is only php.
Invented the angular decision on the basis of that that to me more close:
1. Locally in the project in IDEA (not an essence) it is used Node.js.
2. A script we take a way to a folder, we sort out inside files/folders if it is a folder for this folder as we launch a script.
The script as generates from the received names of files a file with contained in a format json and puts it in a folder which then goes in build together with present folders from a photo.
3. Page React' takes a file with json and through some functions reads from a file objects, takes from objects names of files and further it is already possible to generate ways and to display in any component the photo necessary to us.
Minus of this method that it is necessary to support locally contents of folders with photos (what not so badly -  ) and to add new, is necessary:
And. To add it it is local in a folder with .
. To launch a script for generation of a file with json
Century to Flood photos/ju and a new file with json on ftp.
---
Thanks.

2

Re: Operation with ways to photos without php and node.js on a hosting

So I understand, something is necessary that can periodically update the file list with the names corresponding to some template (*.jpg, *.gif, etc.) in any given directory. If so then approach, for example, find or ls. Probably, with any simple handling on awk. An output to save in a file. Well and on cron to hang up this job.

3

Re: Operation with ways to photos without php and node.js on a hosting

vkle wrote:

So I understand, something is necessary that can periodically update the file list with the names corresponding to some template (*.jpg, *.gif, etc.) in any given directory. If so then approach, for example, find or ls. Probably, with any simple handling on awk. An output to save in a file. Well and on cron to hang up this job.

As a matter of fact, yes, but it not the problem if at us is the (or from a hoster) the server with Node js, for example. And cron with script start in this case too not a problem.
And here is how same to make on the most simple hosting where there is nothing for operation with a server part except as PHP?
Thus not to use PHP smile)
That is we simply physically cannot receive all! Contents of a folder and to process it under the tasks on the client?
If it so it is necessary only locally to launch a script (in my case on javasript using Node js) to generate a file which further we put on the server of a hoster in the project and at reversal to the next page this file is read out analyzed  (on the client) and on this basis the content is generated.
The item with. I would like to be convinced, what correctly I understand a web development basis - we work with files on the server (the exception - folders opened for reading by the client with css, html and other, normally is called public_html at hosters) only using PHP, Node.js etc.? And we cannot simply consider as a script contents of any folder, even knowing a way to any to one of files? We can use only known ways to files?

4

Re: Operation with ways to photos without php and node.js on a hosting

Nixic wrote:

And we cannot simply consider as a script contents of any folder, even knowing a way to any to one of files?

the Server software we can, client - is not present.
On the other hand, for obtaining of the file list of a directory and transmission to its client instead of server scripts + web servers, basically, can be used only the web server. Normally they (web servers, in sense) are able to give the file list of a required directory if only it is authorized a configuration of the server and there is an index file. Certainly, it is primitive enough method, in particular, the list format not too gives in to adjustment.

Nixic wrote:

That is we simply physically cannot receive all! Contents of a folder and to process it under the tasks on the client?

Hardly on this question there is an unambiguous answer. If it is necessary to close a directory from review - it close explicitly. Enough simple for this purpose a method - to suppose in a directory the empty index file. If reading of contents of a directory by the client through the web server - as explicitly it is necessary and resolve.

5

Re: Operation with ways to photos without php and node.js on a hosting

vkle, thanks!
I seem to me something similar just .
As at a hoster the variant is installed apache, here. I will try one of these days.
https://stackoverflow.com/a/20448433
That is, nevertheless it is necessary to understand a little in php))
Under the decision with  I understood that it will return json, but here where it returns it, in the console judging by the code:
echo json_encode ($output);
Well it is fine, I basically understood something, I will understand. From, php, similar anywhere in this case smile

6

Re: Operation with ways to photos without php and node.js on a hosting

It seems cunningly, I can $output write down in a file using standard> or>> _.
And then a file to read ... . Truth as a php-script from this  a file at me will be launched)) after all it is necessary to come on the way to a folder... And can rewrite it that it was launched from any one root folder with where folders from a photo  albums lie, for example albums and  not only files but also folders understood and  on folders and wrote all structure in json.
I.e. it is a certain manual start of a script through reversal to a folder or even to a file with a name from an example above albums/ls_json.php
Nevertheless is easier, than my first variant where - the project in IDEA to open, a script to launch, a file to receive, flood on the server etc.
We flood through ftp new photos, passage to page we activate a script-> received the updated file with names in json.
And further react will already open addresses with albums through a hash /#/album1 and js will read the file list for this album, to generate tags and accordingly a content.
) it is fine... Tomorrow) Ostapa incurred all))

7

Re: Operation with ways to photos without php and node.js on a hosting

What for additional  with everyones there IDEA'? All is easier. And contents of directories change rather rarely.
Such about algorithm:
- Address from the client application to the server script allocated in somebody a certain place. In need of query parameters fill out a name of a demanded directory, types of files (for example, only pictures or only directories) or still that.
- The script checks presence of a ready file under queried data in  and its age (for example, comparing values filemtime () for a file  and directories).
-- At possibility (the directory , than ) gives a file at once as is.
-- If needed ( misses or  directories) reads a directory, forms a content, writes down it in  and gives to the client.

8

Re: Operation with ways to photos without php and node.js on a hosting

Nixic;
Why such hostility to server technologies?
On  to read the file list and to spit out on the client - about what.
"I do not want to learn - there is no time" - so if was going to write on  it is necessary to face modern , and it is more rigid, than .

9

Re: Operation with ways to photos without php and node.js on a hosting

behind a board wrote:

Nixic;
Why such hostility to server technologies?

Only to php))

behind a board wrote:

On  to read the file list and to spit out on the client - about what.

In sense as the decision or "about what" in sense of all ?) If about the decision I generally and wrote at once)

behind a board wrote:

"I do not want to learn - there is no time" - so if was going to write on  it is necessary to face modern , and it is more rigid, than .

With  and js problems are not present, everyones there npm buns ,  from it  and other - already transited stage the matter is that on php did not want to be fastened and use it in personal , and generally.
Read once again the first post (if there is time and desire)))), but already without insults on my judgement about php, let even not the true.
The question after all absolutely in other was. And I would like to do without php.
And so, already looked that it is possible to make - thanks to comments and Google, all is described) read a companion)
And time really is not present, it is necessary to work (tasks in  to close), instead of server technologies to study smile

10

Re: Operation with ways to photos without php and node.js on a hosting

Nixic wrote:

And me it would be desirable to do without php.

Well so on PHP there are other fish in the sea. Simple, it is possible to write a script on everything that is able to communicate with file system more or less at least. It can be both perl and bash (or sh) with a call of necessary system level commands as above wrote already, find + awk, for example. All this good is normal is on any * the server. That else comes across quite often - python, ruby. But not always and not everywhere.

Nixic wrote:

And time really is not present, it is necessary to work (tasks in  to close), instead of server technologies to study smile

What, , server technologies? To read the directory and to produce the formatted answer - in the elementary case it is the task in three-five lines of the code. In the elementary. And in the full type the task has not been stated. A subject, in general that, from examples on programming essentials. If there is a question of choice  - write that know is better and can debug and finish to working state.

11

Re: Operation with ways to photos without php and node.js on a hosting

vkle wrote:

Well so on PHP there are other fish in the sea. Simple, it is possible to write a script on everything that is able to communicate with file system more or less at least. It can be both perl and bash (or sh) with a call of necessary system level commands as above wrote already, find + awk, for example.

And well understood, that is any hosting for 2 and even for 1 dollar in a month gives possibility to launch any scripts in any language on their server, such logic? I seriously ask, suddenly I that do not know, I assumed that scripts can be launched on such hosting only that is, in c php.

12

Re: Operation with ways to photos without php and node.js on a hosting

vkle wrote:

the Subject, in general that, from examples on programming essentials. If there is a question of choice  - write that know is better and can debug and finish to working state.

Here it was now insulting))) As though I at the first year and to me started to explain that such variables and reset of functions in ))

13

Re: Operation with ways to photos without php and node.js on a hosting

Nixic wrote:

that on php did not want to be fastened and use it in personal , and generally.

then then the hosting will be more expensive

14

Re: Operation with ways to photos without php and node.js on a hosting

Nixic;
At you the strange manner of presentation.
I some times re-read your first posting, yet did not understand that you generally want to do without server technologies. To unwinding it is read as "without PHP, but with NodeJS"

Nixic wrote:

In sense as the decision or "about what" in sense of all ?)

In sense - on NodeJS to read the directory of files and to give on the client - a trifle to some lines.
And to put files through ftp, and then to stir up any scripts on bashe/whatever, in passing solving problems  is smells slightly at all of the first course.

Nixic wrote:

but already without insults on my judgement about php,

Yes to me  on PHP

Nixic wrote:

And time really is not present, it is necessary to work (tasks in  to close)

With such approach, very soon "close tasks in " can to become irrelevant.

Nixic wrote:

With  and js problems are not present, everyones there npm buns ,

Porridge in a head.

15

Re: Operation with ways to photos without php and node.js on a hosting

behind a board wrote:

it is passed...
Porridge in a head.

Happens, I sympathize))

16

Re: Operation with ways to photos without php and node.js on a hosting

behind a board wrote:

I your first posting some times re-read, yet did not understand that you generally want to do without server technologies. To unwinding it is read as "without PHP, but with NodeJS"

And that here not clear))
On a hosting is not present Node js, but is php.
Owing to that I php as a matter of fact do not know, wanted to do without it. And here decided to ask, what variants are.
The project on  made c npm in IDEA, the most standard method.
Further there was a question how to update files and  to them, without usage php.
As  (and not it one) perfectly works with json, decided to give it it, and on a client page to generate a content.
Pepper is clear that I cannot simply create on the client connection to a DB, from here and came to mind to give it a file with names in json.
The curve decision with start locally Node js a script, working, but it is not pleasant to me, because  each time it all here to make.
On a hosting, I saw that is cPanel in it is crones, before I did not see it. I do not know while how there it works, but under the description understood that it is necessary to give scripts php. Is as any perl-modules, but I am absolutely far from it.
As a result, apparently from the previous comments - without php here not to manage. It will generate that file json.
It is necessary to mention that operation of the client through a file in times faster than if we pulled all from a DB, well it I already departed from a subject towards arguing of cost of connections to a DB, operation with  and .

17

Re: Operation with ways to photos without php and node.js on a hosting

Nixic wrote:

it is passed...
And well understood, that is any hosting for 2 and even for 1 dollar in a month gives possibility to launch any scripts in any language on their server, such logic? I seriously ask, suddenly I that do not know, I assumed that scripts can be launched on such hosting only that is, in c php.

strictly speaking, quite there are tariff plans and at all without the rights of performance of server scripts and without possibility of configuring of the web server and without databases. Only stupid return of a content immediately from file system. Your project should and to work on such hosting? In general that, here rises a question "who on whom lay". Or the task dares in the conditions of a hosting with rather restricted possibilities but then there is a sense explicitly to specify more or less the complete list of its possibilities. Or the hosting for project layout should correspond to some minimal requirements.
So, let's be defined that we will consider here - a certain real hosting server with its possibilities or a spherical hosting in vacuum. In the latter case explicitly it is more than hypothetical possibilities.
That it is authorized to do on a hosting and that is impossible - this question is supervised by the manager of the server. Whether it is possible to launch a script only language PHP or it is possible also scripts on others  to use is, besides to a hoster a question. There are variants with jail where the performance right only several system level commands, though on their server very much everyones is given the user.

18

Re: Operation with ways to photos without php and node.js on a hosting

behind a board wrote:

it is passed...
With such approach, very soon "close tasks in " can to become irrelevant.

With what it with such approach?))
About  it there was a hint, that I as though not absolutely the sucker in a subject of development and something, nevertheless, understand, and work with rather serious and big project. That was not such that someone  in this subject will correct and send a crown to itself(himself), well we admit, in the same Google)
Each of us in something is better than another, but it not an occasion to make mischief and under % No  at each opportunity.
Yes, I never worked with php and did not adjust a hosting and what? It is impossible to ask about availability of files and operation with them?))

19

Re: Operation with ways to photos without php and node.js on a hosting

Nixic;
It is difficult to me to track your flight of thought.
I want to put files through ftp, start local nodeJS a script...
If I correctly understood all, I think, it is necessary to look towards a Web server (the apache?).
Probably, he can consider files from a directory, and produce to their client through any script.

20

Re: Operation with ways to photos without php and node.js on a hosting

behind a board wrote:

If I correctly understood all, I think, it is necessary to look towards a Web server (the apache?).
Probably, he can consider files from a directory, and produce to their client through any script.

Yes, so. Truth I yet did not try, since from company Apache Software Foundation many years I work not with Apache server which http, and with Apache Tomcat, the container of servlets in which  projects c a server part on Java, and never the HTTP-server especially investigated into adjustments Apache.
But judging by articles and questions/answers on  with Apache it is possible to work through php, it and other languages supports, they are connected there modularly.
And judging by cPanel in a private office of a hoster, there is besides php and perl.
Here through script start on php also it will be possible to generate a file in json with the content of structure with names of files  from directories.
And, like as, there is at a hoster such possibility/option in the same cPanel as performance of jobs, start of scripts,  cron, truth it is necessary to understand still as with it to work. In this case, it is possible to deliver a php-script on performance everyone, we admit minute that hands not to launch.
As a result should receive torn on Apache the project in which it will be possible simply on ftp to add files and to look result through any time when the script updates contents json.
The item with. Generally it is possible on  (it not in essence)  generation of the menu and pages with photos only on the basis of structure of a file with json. Or several files for convenience of review by eyes.

21

Re: Operation with ways to photos without php and node.js on a hosting

Nixic wrote:

But judging by articles and questions/answers on  with Apache it is possible to work through php, it and other languages supports, they are connected there modularly.

the Apache has not enough Units for support . If there is no support necessary  by means of CGI it is possible to use a script on any  which is supported in system or any program which can be launched. There is enough, that a script or the program was able to read stdin and to give result in stdout. Well and in the documentation have a look, there more exhaustive information, rather than on .

Nixic wrote:

And, like as, there is at a hoster such possibility/option in the same cPanel as performance of jobs, start of scripts,  cron, truth it is necessary to understand still as with it to work. In this case, it is possible to deliver a php-script on performance everyone, we admit minute that hands not to launch.

Support cron - ordinary enough phenomenon, is regular service of any *nix the distribution kit. It is difficult to find a hosting without it, perhaps, only most  tariff plans. Another matter that it is necessary to estimate its practical usefulness. Here estimate, at periodicity one minute for days it will be 1440 starts, for a week - more than ten thousand. How many time a day is on the average flooded new files how it is a lot of requests from clients? At thousand adding and millions requests, obviously, there is a sense to make the centralized update of lists on a crone that the client took away at once the ready list. At individual adding it is already slightly doubtful, when it appears useful about one start on one thousand.

Nixic wrote:

to look the result through any time

And here it is one more "trouble" at start on a crone. By the way, some hosters restrict frequency of start. Like, the minimum interval ran into Masterhoste on such, there five minutes. Though, it, more likely, an exception to the rules.
Well and one more stone in a kitchen garden a crone - at moving on other hosting it is possible is banal to forget to transfer the job. Alas, such not a rarity.

22

Re: Operation with ways to photos without php and node.js on a hosting

Nixic wrote:

which http, and with Apache Tomcat, the container of servlets in which

You are a good fellow.

Nixic wrote:

  cron to understand as with it to work.

Nixic wrote:

  to deliver a php-script on performance

Nixic wrote:

with Apache it is possible to work through php,

It is that it is not necessary.
Make on the same  a web method which in  will give contents of a certain directory - and all.
Without  and generated json-files.