sneakyimp;10984016 wrote:You're leaving out a lot of gaps here.
What is a "report" ? A spreadsheet? A document? A web page? A data document? When you are offline, how is the report created or edited? Are you using a spreadsheet? Do you have a webserver and PHP running locally and you are submitting images to it?
You mention "the php script" without specifying whether it is running on a web server or running locally while you are offline.
How does FTP come into play?
Just when you thought you explained everything clearly lol 🙂
A report in this case is a web page, in this case containing information about the testing of a product. The report details are held in several MySql tables, plus the report may contain images (jpg) that are stored in a folder.
The offline version of the system is run from Localhost, the Laptops where this is installed running Apache, MySql, PHP etc.
If a test report has been updated offline (using PHP programs), the data from the SQL tables, and the associated images, need to be uploaded to the online version of the system.
To upload a report, the user clicks on a button next to the report on the web page that lists active reports, and this runs a PHP program that prepares a form containing the data to be uploaded. It then FTP's the images to the server, before auto-submitting the form to a PHP program on the main server.
The problem is when the script times out, and the upload crashes. Sometimes the images are not transferred.
I have extended the FTP connection time to 240 secs and the PHP max time to the same, in the PHP program, but wondered if there was a better way of uploading the images. Ideally it would be nice to add them to a queue to be uploaded to the server, allowing the form to be completed and the main report uploaded.
I hope this makes more sense.
Right now I have improved the code a lot, and set it so that only new images that were added will be uploaded, not all the images on the report, but the user is still seeing problems.
With the user being in China and me in the UK, it's not easy to duplicate the situation.