Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
$filepath = "$DOCUMENT_ROOT."/upload/";
$handle = opendir($filepath);
unset($files);
while($file = readdir($handle))
{
if(ereg("^\.+$",$file)) $files[]= $file;
}
closedir($handle);
if(!in_array($upfile,$files)) //$upfile is der Dateiname der neuen Datei
{
//UPLOAD-SCRIPT
}
else
{
echo "Datei schon vorhanden!";
}
if ($file_name)
{
$path_to_file = "/usr/local/httpd/htdocs/page/upload/";
while(file_exists($path_to_file.$file_name)){
$file_name = "1".$file_name;
}
$location = $path_to_file.$file_name;
copy($file,$location);
}
if ($file_name)
{
$path_to_file = "/usr/local/httpd/htdocs/page/upload/";
for($i=1;file_exists($path_to_file.$file_name),$i++){
$temp = explode(".",$file_name);
$temp[count($temp)-2] .= $i
$file_name = join(".",$temp);
}
$location = $path_to_file.$file_name;
copy($file,$location);
}