v8.01 (build: Jan 4 2020)

Reports generator - Sending to website

It is possible to send reports to your web site.
This action is similar to the one when you will press the button "Send a file" on your website and you will transfer the report files to the website.
Then you can send it by mail, save in the folder on the server or record to SQL base.
Usually php or cgi-script accept files from the server side.
The data is transferred via HTML form on the client's side.
In the parameter "Full URL of http POST request" it is necessary to specify script location that performs loading to the server.
It is worth knowing that the file will be stored in the variable with the name "uploadedfile". This name must be used in the script on the server.

Below one can find examples of client's file (HTML page) and script on the server (PHP) to see how this option is functioning:

; --------------------
; file upload.html
; --------------------
<form enctype="multipart/form-data" action="http://mysite.com/action.php" method="POST">
<input name="uploadedfile" type="file"><br>
<input type="submit" value="send a file">

; --------------------
; file action.php
; --------------------
// this folder must exist on the server!
$target_path = "uploads/";
$target_path = $target_path . basename($_FILES['uploadedfile']['name']); 
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
    " has been uploaded";
} else{
    echo "There was an error uploading the file, please try again!";

This is how the file upload.html is functioning in the program which allows to send files automatically!
The file similar to action.php must be located on your web server.

© Mirobase