hi,
I would like to know if it is possible to automatically create an empty txt file on the server when a new picture is added.
For example:
picture1.jpg is added (through ftp, or through back-end of my content mangament system)
the server "produces" the picture1.txt file
Similarly, whwn you remove picture1.jpg, also the picture1.txt file is gone.
thanks
automatically add txt files into server folders
Moderator: General Moderators
Re: automatically add txt files into server folders
Yes, it's possible.
There are 10 types of people in this world, those who understand binary and those who don't
Re: automatically add txt files into server folders
thanks!
How can I do it ?
How can I do it ?
Re: automatically add txt files into server folders
http://bg2.php.net/manual/en/ref.filesystem.php
http://bg2.php.net/manual/en/function.f ... ntents.php
http://bg2.php.net/manual/en/function.unlink.php
http://bg2.php.net/manual/en/function.f ... ntents.php
http://bg2.php.net/manual/en/function.unlink.php
There are 10 types of people in this world, those who understand binary and those who don't
Re: automatically add txt files into server folders
thanks, one more question:
how can I detect when a file is uploaded or added to a specific folder ?
I need it working if I use ftp or back-end as well.
thanks
how can I detect when a file is uploaded or added to a specific folder ?
I need it working if I use ftp or back-end as well.
thanks
Re: automatically add txt files into server folders
When the file is uploaded via HTTP file upload form you should create (using the same PHP script) the TXT file at the time file has been uploaded successfully.
FTP uploads ... Some of the FTP servers have abilities to run user defined scripts on file upload/download.
Another approach would be to create a cron job (scheduled task) which periodically checks for new files.
FTP uploads ... Some of the FTP servers have abilities to run user defined scripts on file upload/download.
Another approach would be to create a cron job (scheduled task) which periodically checks for new files.
There are 10 types of people in this world, those who understand binary and those who don't