System information
An Introduction to PHP3
Axis Communications AB provides NO support for application development of any kind. The information
here is provided "as is", and there is no guarantee that any of the examples shown will work in your
particular application.
Revision 1.02 October 2002 33
4.2.4 Example 4 – Sequential FTP Upload
When input 0 goes high, this script will, for 10 seconds, upload images via FTP, at 2 second
intervals. The uploaded images can be named by specifying a suffix. These can be date,
incremental sequence number or limited sequence (overwrites files when maximum is reached).
The parameters come first:
<?
$buffer_prefix = "SNAP"; // The prefix of the name
//of the buffer(s) started
$sources = "1"; // The index of the name(s) of the
// buffer(s) started
$image_format = "fullsize"; // The format of the images
//specified to be taken
//according to the HTTP-API
$delay = 2000; // Delay between images //taken
$file_format = "snapshot"; // The name to be given to
//the local file, excluding
//the extension
$ftp_server = "10.13.9.130"; // The server to upload to
$port = "21"; // The port to connect to
$user = "user"; // The user to login as
$pass = "pass"; // The pass to use for the
//user
$passive_mode = "no"; // Choose passive mode on
//("yes") or off ("no").
//(See documentation on FTP
//protocol)
$destination = "upload/2400"; // The path to append to all
//uploads. This path must exist on
// the server prior to upload.
$time = 10; // The time, in seconds, to stay
// in this script. A value of -1
// means indefinitely.
$suffix= "date"; // The type of suffix to use on
//the uploaded files. Use "date"
//for the date,
//$suffix = "sequence"; or
//"sequence" for an index
//$counter_max = 10; Limited by an
//integer. $suffix =
//"sequence_max"; Or
//"sequence_max" for an index up
//to the internal maximum integer.