I am trying to build a solution where I sync a local directory with a ftp server directory. Then the files in the local directory should be send to Jira as a specific issue.
I am trying to understand how I can make script which watches the local directory and when a new file (.pdf) and attachments is created (Look after file id) send a create command to Jira with some data from this newly created file.
Currently i have made the powershell script which reads the FTP and sync's the files to a local directory. Could the rest be made in PHP?
Regards,
Kristian
PHP and PowerShell are both very powerful languages with extensi9on capabilities so you can pretty much do anything you want with both of them. PHP is also available on windows, so I see no objection to writing the whole thing in php.
However, seeing that you already built something in PowerShell, i would recommend that you register the freshly downloaded files in Jira with the same script. Otherwise you would have to build the logic for detecting the changes/additions twice.
Related
I just want to Send a file On the web server through FTP. and what i want mainly is i have a file on which i have some code for processing this file(it will be Csv) and i want to process this code automatically after uploading through FTP.Can any body please help. i have no idea about this. is there any FTp functions which will work for this.please let me know,
Install a Grunt watch task on the server which will watch for changes in the FTP folder. It's easy to install via Node's NPM.
http://gruntjs.com
This will immediately trigger a script including PHP CLI scripts to post-process your uploaded files, and is easy to configure yet powerful in scope.
I have developed an C++ application which reads from 2 input files.
The app analyzes the files, and in response creates a new file with new information.
All of the above works on my machine, but recently the project's managers added a request to make a Web GUI.
The users should be able to load the 2 files from their local machine to the folder and than the server will run the EXE file that will put a new output file in the folder.
When the EXE is done running, the output file will be represented to the user in the client side.
I am in charge of the application, so we hired a company to make the web side.
The EXE file is located on the server with the web site files.
The company wrote it in PHP, and when a user wants to get the output file, they run the EXE file with the function "exec".
In response they get an error that this function isn't available because of security issues.
From what I understand, all that needs to be done, is to enable the function from php.ini,
but the company told me that the problem is with my application.
I'm writing this question, because I'm not sure how this should be done, and I wanted to know what is the right way to go, in order to answer the project requirements.
Maybe a web service, written in C++ that will replace my EXE file?(tell me if i'm completely wrong :))
Thanks a lot, Ben.
I have network storage which is available for me. My job is to create script which will daily download updated files from this storage ( file to download have same name just content is different).
And here is question to You because I'm not very experienced in writing scripts ( only php and little bit sh).
I tried using samba and class which is available here but this class is supposed to create UI to download files manually which is not what I am looking for.
Can You please tell me any other way how can I download files from network storage?
Network file system, using PHP and MongoDB
http://verens.com/2014/11/06/distributed-file-storage-using-php-and-mongodb/
thanks all of you for patiently answering my question "About exec() function in PHP: About exec() function in PHP", it has given me an idea of how this works and so. Lots of them pointed the syntax error, my pardon forgot to include the quotes.
Actually I have got a requirement in normal conditions the customer has the .exe file which he needs to normally run from command prompt, where he needs to include the path for the license and config files manually, so that application is valid for installation.
Now he wants a php script where he will enter the web page with his valid login details and with the click of link he should be able to run the .exe file to install the software on his machine. Including the license and config file is my job which I have been working on, on the other hand I am still not clear that this is really possible to run the .exe file on the clients machine when the script runs on the php remote server. What can be the other alternatives to accomplish this. Can anyone clear my doubts?
You cannot run anything on the client machine from a PHP script running on the server. It's impossible. What you can do is create an archive (e.g. ZIP) that contains the executable file, the license file and the configuration. Then you can offer this archive to the user as download. After extracting the archive on his machine he then would be able to execute the application.
Other possibilities to execute something on the client machine would be a Java applet or a Flash application. Those are subject to a lot of security restrictions though.
Alternative:
1.Save settings to file
2.Compact programm to archive with setting file && license
3.Download archive
PHP is on the server, the server generates HTML/JS/CSS. The PHP process ends before the web page is displayed to the user.
There's no way, and a VERY VERY good reason why this can not or will never be able to be done.
And why would you want to run an .exe file on someone's computer other than malicious reasons?
You're on the Web, sell subscription, what licensing are you talking about?
There is no way to actually execute a program on the client machine directly from PHP. The best you can hope to achieve is to provide a download for the executable file and then the client can execute it manually. You could provide an archive file with the installation executable and config/license file(s), but the client would still have to execute the file manually.
You could potentially use client-side technologies such as Flash, Java or ActiveX to accomplish this, but this is not a simple task and requires fairly intimate knowledge of the languages on which these technologies are based.
If the file was an MSI, it would be theoretically possible to allow the server to remotely install it on the client machine, however there are some barriers to this:
You need a fully fledged Windows domain for this, and both the server and client machines would have to be members of that domain. There is no way around this.
You would most likely need to know the NetBIOS name of the client machine, and there is AFAIK no 100% reliable way to determine this from PHP.
Your PHP instance would need to be running under an account that has administrative privileges in the domain. This is unlikely to be the case at the moment, and it is not a very good idea to run like this anyway.
I am working on a custom PHP/MySQL CMS. The data managed in the CMS is exported to XML files via a PHP script that must be ran manually. A Flash/AS3-based front-end loads the XML files and displays the specified data.
Is it advisable to setup some sort of automated process for creating the XML files?
What are some "best-practices" or related advice?
Thanks!
If you have os access, then of course you can create these files via CRON for unix or linux or Scheduler on Windows. If the process only actually needs to regenerate files when things have changed, your data change process can additionally put the "refresh" request into a Queue (either a flat file or database table) that is then picked up by the script that generates the XML files to know which should be rerun. If all of the files should just be generated on a periodic basis, then code the script to process all and set that to run from whatever scheduler you are using.
If you don't have OS access, you can code it in a php page that requires credentials and setup a scheduler with a script on your desktop to just call out to the page to tell it when to refresh when given the proper credentials.
I suggest:
Set Flash script to read XML file from /location/file.php
This file.php can generate XML and output it to Flash
You can make cashing mechanism on that file.php