Hi anthemia,
I suggest you use method "CopyTo" to save the upload files. It allow you handle the upload file store location and the new file name. Then you can check if the file exist or not. If exist, fire your own logic to handle it by the CopyTo method.
The example below shows you how to use the CopyTo method to save the upload file.
- <?php require_once "phpuploader/include_phpuploader.php" ?>
- <?php session_start(); ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>
- Form - Start uploading manually
- </title>
- </head>
- <body>
-
- <form id="form1" method="POST">
- <?php
- $uploader=new PhpUploader();
- $uploader->MaxSizeKB=10240;
- $uploader->Name="myuploader";
- $uploader->InsertText="Select multiple files (Max 10M)";
- $uploader->AllowedFileExtensions="*.jpg,*.png,*.gif,*.txt,*.zip,*.rar";
- $uploader->MultipleFilesUpload=true;
- $uploader->Render();
-
- ?>
-
- </form>
-
-
- <?php
- $fileguidlist=@$_POST["myuploader"];
- if($fileguidlist)
- {
- $guidlist=split("/",$fileguidlist);
- foreach($guidlist as $fileguid)
- {
-
-
- $mvcfile=$uploader->GetUploadedFile($fileguid);
- if($mvcfile)
- {
- <!-- check the file here, exist or not, then use the CopyTo to handle the new file name.$mvcfile->FileName is the original file name-->
- $mvcfile->Copyto("D:/phpuploader/photos/".$mvcfile->FileName);
- }
- }
-
- }
- ?>
-
- </div>
- </body>
- </html>
Regards,
Ken