$uploader->SaveDirectory

Last post 11-30-2009, 2:53 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  11-27-2009, 1:21 AM 57452

    $uploader->SaveDirectory

    Hello Support,
     
    I'm trying to use $uploader->SaveDirectory to save file in the folder. I want to get the name of the file after the file is uploaded also. It seems I can get the name of he file but the file is not uploaded. Please advise.
     
    Thank you
  •  11-30-2009, 2:53 PM 57506 in reply to 57452

    Re: $uploader->SaveDirectory

    Please try the following code:
     
    1. <?php require_once "phpuploader/include_phpuploader.php" ?>   
    2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">   
    3. <html xmlns="http://www.w3.org/1999/xhtml">   
    4. <head>   
    5.     <title>Demo 1 - use SaveDirectory property</title>   
    6. </head>   
    7. <body>   
    8.     <div>   
    9.        
    10. <hr/>   
    11.        
    12.     <?php   
    13.         $uploader=new PhpUploader();   
    14.            
    15.         $uploader->MultipleFilesUpload=true;   
    16.         $uploader->InsertText="Select multiple files (Max 1000M)";   
    17.            
    18.         $uploader->MaxSizeKB=1024000;   
    19.         $uploader->AllowedFileExtensions="*.jpg,*.png,*.gif,*.bmp,*.txt,*.zip,*.rar";   
    20.            
    21.         $uploader->SaveDirectory="savefiles";   
    22.            
    23.         $uploader->FlashUploadMode="Partial";   
    24.            
    25.         $uploader->Render();   
    26.            
    27.     ?>   
    28.        
    29.     </div>   
    30.            
    31.     <script type='text/javascript'>   
    32.     function CuteWebUI_AjaxUploader_OnTaskComplete(task)   
    33.     {   
    34.         var div=document.createElement("DIV");   
    35.         var link=document.createElement("A");   
    36.         link.setAttribute("href","savefiles/"+task.FileName);   
    37.         link.innerHTML="You have uploaded file : savefiles/"+task.FileName;   
    38.         link.target="_blank";   
    39.         div.appendChild(link);   
    40.         document.body.appendChild(div);   
    41.     }   
    42.     </script>   
    43.        
    44. </body>   
    45. </html>  

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML