It looks like you're new here. If you want to get involved, click one of these buttons!
if (file_exists($targetFile)) {
// update to new version
// ... code to add version and check if that new name exists ...
$targetFile = str_replace('//','/',$targetPath) . $newfilename;
}
if (file_exists($targetFile)) {
// update to new version
// ... code to add version and check if that new name exists ...
$targetFile = str_replace('//','/',$targetPath) . $newfilename;
}<?php
// Uploadify v1.6.2
// Copyright (C) 2009 by Ronnie Garcia
// Co-developed by Travis Nickels
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/';
$file = $_FILES['Filedata']['name'];
$file = utf8_decode($file);
$file = ereg_replace(\"[^a-zA-Z0-9_.-\[\]()]\", \"\", strtr($file, \"()áàâãäéèêëíìîïóòôõöúùûüçÁÀÂÃÄÉÈÊËÍÌÎÏÓÒÔÕÖÚÙÛÜÇ \", \"[]aaaaaeeeeiiiiooooouuuucAAAAAEEEEIIIIOOOOOUUUUC_\"));
$aux_targetPath = str_replace('//','/',$targetPath);
$targetFile = str_replace('//','/',$targetPath) . $file;
$returnFile = $_FILES['Filedata']['name'];
$fnamecnt= 1; //sets a count variable to increment filenames
while(file_exists($targetFile)) {
$targetFile = $aux_targetPath . $fnamecnt . \"-\" . $file;
$fnamecnt = $fnamecnt + 1; //increment count by 1
}
move_uploaded_file($tempFile,$targetFile);
}
echo \"1\";
?>