Upload PDF via (S)FTP or HTTP(S)

The PDF Printer has a feature that will upload the created PDF file to a server. Both FTP and HTTP uploads of the PDF document are supported. This means that you can send the documents to a web server that you have created and do some processing in a cloud application.

Uploading to an FTP or SFTP server is simply a matter of setting up a server to receive the files.

HTTP and HTTPS are supported via the normal file upload protocol. It requires that you create a script on your server that will receive the uploaded file.

You can test your upload script by creating a simple “File Upload” form on a web page. The code could look something like this:

<form action="upload.php" method="post" 
    enctype="multipart/form-data">
    Select file to upload:<br>
    <input type="file" name="file" id="file"><br>
    <input type="submit" value="Upload File" 
    name="submit"><br>
</form>

The page that receives the file can be written using any web server language. Here is an example in PHP.

$filename = basename($_FILES["file"]["name"]);
if (move_uploaded_file($_FILES["file"]["tmp_name"], 
    $filename.".tmp")) 
{
    // This file is copied so that IIS 
    does not set itself as owner of the file.
    copy($filename.".tmp", "uploaded-".$filename);
    unlink($filename.".tmp");
    echo "The file '".$filename."' was uploaded.";
}
else
{
    echo "Error";
}

Configure the printer for upload

You can tell the printer to upload to your HTTP handler by adding these settings:

uploadprotocol1=HTTP
uploadserveraddress1=http://yourserver/your_script.php

Additional parameters are available for setting password and user name if needed.

http://www.biopdf.com/guide/settings.php

The upload settings can be set from a program using the API or in the global.ini files that control the global settings for a printer.

http://www.biopdf.com/guide/global_ini.php

This an example of typical settings to set when working with an upload scenario.

Output=my output file name
ShowSettings=never
ShowPDF=no
ShowProgress=no
ShowProgressFinished=no
ConfirmOverwrite=no
StatusFile=my status file name
StatusFileEncoding=unicode
DeleteOutput=yes
suppresserrors=yes
uploadprotocol1=HTTP
uploadserveraddress1=http://localhost/test/upload.php