I have a PHP networking question. I'm trying to create a form that allows clients to upload a PDF attachment. Once the file is uploaded I want PHP (or MySQL) to check if the file is a PDF and if it IS to generate a cover sheet AND print both the generated cover sheet and the uploaded PDF to a network printer. Finally I need the script to send an email to me telling me a file is waiting for me on the printer.

Does anyone have ANY ideas how I might go about scripting such a thing? (I have no experience with networking with PHP)

    checking if it's a pdf is easy (just see if the last 3 letters are .pdf as a quick one). But it would have to be your server (i.e. apache) that triggered the network print, and I don't know how you'd do that, or even if it can. Then the email bit is again easy - just get the upload receiver script to send a mail.

    think you'd find it much easier if you got the script to check if the uploaded file was a pdf, and if it is then copy it to a folder on the server and email you. You can then check the folder periodically, print any that are in there, and move them to a new folder (or delete them) when they're printed.

    I'm not sure there are easy (or any) ways to print without a dialogue box coming up - if there were, you'd see a deluge of viruses coming out with people's printers just chucking out adverts all the time without asking the user if they wanted them printed. It'd be like pop-up windows, only much, much worse!

      Write a Reply...