????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.37 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/icad.astacus.se/customerzon/JavaPowUpload_old/FileProcessingScripts/PHP/ |
Upload File : |
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
/*
JavaPowUpload builtin log area supports only limited count of HTML tags. You can find list here
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/text/html/HTML.Tag.html
*/
echo 'Upload result:<br>';
$uploaddir = dirname($_SERVER['SCRIPT_FILENAME'])."/UploadedFiles/";
$target_encoding = "WINDOWS-1251";//"ISO-8859-1";
$filedNames['FilePath']="FilePath_#COUNTER#";
$filedNames['RealFilePath']="RealFilePath_#COUNTER#";
$filedNames['FileSize']="FileSize_#COUNTER#";
$filedNames['FileLastModified']="FileLastModified_#COUNTER#";
$filedNames['FileMD5']="FileMD5_#COUNTER#";
echo '<pre>';
$i=0;
if(count($_FILES) > 0)
{
//save files
foreach($_FILES as $name=>$arrfile)
{
$uploadfile = $uploaddir . iconv("UTF-8", $target_encoding,basename($arrfile['name']));
if($name == "FileBody_".$i)
if (move_uploaded_file($arrfile['tmp_name'], $uploadfile))
{
echo "File ".$arrfile['name']." is valid, and was successfully uploaded $name.<br>";
echo "File saved to: ".$uploadfile."<br>";
echo "FilePath: ".$_POST[str_replace("#COUNTER#", $i,$filedNames['FilePath'])]."<br>";
echo "RealFilePath: ".$_POST[str_replace("#COUNTER#", $i,$filedNames['RealFilePath'])]."<br>";
echo "FileSize: ".$_POST[str_replace("#COUNTER#", $i,$filedNames['FileSize'])]."<br>";
echo "FileLastModified: ".$_POST[str_replace("#COUNTER#", $i,$filedNames['FileLastModified'])]."<br>";
echo "FileMD5: ".$_POST[str_replace("#COUNTER#", $i,$filedNames['FileMD5'])]."<br><br>";
$i++;
}
}
$i=0;
//save thumbnails.
foreach($_FILES as $name=>$arrfile)
{
$uploadfile = $uploaddir . iconv("UTF-8", $target_encoding,basename($arrfile['name']));
if($name == "ThumbnailBody_".$i)
if (move_uploaded_file($arrfile['tmp_name'], $uploadfile))
{
echo "File ".$arrfile['name']." is valid, and was successfully uploaded $name.<br>";
echo "File saved to: ".$uploadfile."<br>";
echo "ThumbnailPath: ".$_POST["ThumbnailPath_".$i]."<br>";
echo "ThumbnailRealFilePath: ".$_POST["ThumbnailRealFilePath_".$i]."<br>";
echo "ThumbnailFileSize: ".$_POST["ThumbnailFileSize_".$i]."<br>";
echo "ThumbnailFileMD5: ".$_POST["ThumbnailFileMD5_".$i]."<br>";
echo "Url to thumbnail: ".dirname($_SERVER['PHP_SELF'])."/UploadedFiles/".iconv("UTF-8", $target_encoding,basename($arrfile['name']))."<br><br>";
$i++;
}
}
}
else
echo 'No files sent!';
echo 'Here is some more debugging info:<br>';
echo 'FILES:';
print_r($_FILES);
echo 'POST:';
print_r($_POST);
echo 'GET:';
print_r($_GET);
echo "</pre>";
?>