Upload Bugreport

delphi package - automated exception handling
Post Reply
Sanchez
Posts: 6
Joined: Tue Aug 30, 2005 7:50 am

Upload Bugreport

Post by Sanchez »

Hi Madshi,
First of all, thank for this great tool, I really like the new features in version 3. But I have problems with one of these new features.

I thought with the option "mail or upload directly via internet" -> "upload to http web server" enabled, MadExcept uploads the bugreport and the screenshot to the script in HTTP-Server. To find out about the structure of this upload, I wrote an upload-script like this:

Code: Select all

$handle = fopen("log.txt", "a");
if ($handle != 0)
{
  fwrite($handle, 'POST: '.date('YMDhns')."\n");
  foreach($_REQUEST as $key => $value)
  {
     fwrite($handle, '  '.$key.' - '.$value."\n");
  }
  fwrite($handle, "\n\n");
  fclose($handle);
}
Well, the only transmitted parameter seems to be the senders email-adress, but I checked either "attach bug report" and "attach screenshot" at the attachment-settings. Do you have any suggestions?

regards, daniel
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

I'm not really a PHP expert (not at all). Here's the
script I used for testing. Does it help?

Code: Select all

<?php
  if (!isset($_SERVER['REMOTE_USER']) || (!$_SERVER['REMOTE_USER'])) {
    header('WWW-Authenticate: Basic realm="private"');
    header('HTTP/1.0 401 Unauthorized');
    echo 'Authorization failed.';
  } else {
    if (isset($_POST)) {
      foreach($_POST as $key => $val) {
        if (!$val) {
          echo "field \"".$key."\" empty<br>\n";
        } else {
          echo "field \"".$key."\" -> \"".$val."\"<br>\n";
        }
      }
    }
    if (isset($_FILES)) {
      foreach($_FILES as $key => $val) {
        if (($val['error']) || (!move_uploaded_file($val['tmp_name'],
'./'.$val['name']))) {
          echo "file upload \"".$key."\" failed<br>\n";
        } else {
          echo "file upload \"".$key."\" succeeded ->
\"".$val['name']."\"<br>\n";
        }
      }
    }

  }
?>
Sanchez
Posts: 6
Joined: Tue Aug 30, 2005 7:50 am

Post by Sanchez »

:oops: I expected the uploaded files in the $_POST-Array. I was examine the post-Array to find the two files. You see, I am not a php-pro too.

Thanks a lot
Post Reply