Sample> FileControl

<?php

// include TPLN
include('TPLN/TPLN.php');

$TPLN = new TPLN();
$TPLN->open('fileControl.html');

$TPLN->formSetLang('en');
$TPLN->fileControl('myfile'1'500Ko''''jpg');
if(
$TPLN->formIsValid())
{
    
// automatic upload image file
    
$TPLN->fileUpload('myfile''image''upload.jpg');

    
// and create thumbnail with max width:150px or max height:150px, you can also assign a bicubic constraint
    
$TPLN->imgThumbnail(150150false);
}

$TPLN->write();


?>
<html>
<head>
    <title>fileControl.html</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../style.css" rel="stylesheet" type="text/css" />
</head>

<body>

<bloc::form_error>
  <div style="font-weight:bold;color:red;">• {msg}</div>
</bloc::form_error>

<form action="" method="post" enctype="multipart/form-data" name="form">
<p>Please select a jpg file (< 500 ko) : <br>
<br>
    <input type="file" name="myfile" id="myfile" style="width:500px;" />
    <input type="hidden" name="posted" value="1" />
</p>
<p>
    <input type="submit" value="Upload" >
</p>
</form>

<bloc::form_valid>
<div id="form_valid">
Your form was submitted without errors !<br>
  And replaced by bloc form_valid !

  Your image is uploaded and transformed in a thumbnail : <br />
  <br />
  <img src="image/upload.jpg" style="border:4px solid #ccc;" />

</div>
</bloc::form_valid>

<br>
<br>
{_Logo}<font size="1"> in {_Chrono} s<br>
Queries executed: {_QueryCount}</font>
</body>
</html>