Avatar of Mark
Mark

asked on 

How to wait for file to be closed before reading

I have my scanner here at the office FTP'ing scanned documents to a server.

Additionally, I have a php script running indefinitely checking the ftp upload folder and creating thumbnails for those PDF images.

The problem is, if the scanner hasn't finished writing the document to the ftp server, the script fails because it is not a valid PDF document.

I am using ghostscript to create the pdf preview if that helps and my ftp server is proftpd. The server is Ubuntu 14.04 LTS.
PHP

Avatar of undefined
Last Comment
Mark
ASKER CERTIFIED SOLUTION
Avatar of Mark
Mark

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
PHP
PHP

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

125K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo