Re: Refreshing the page after upload

  •  08-19-2009, 4:30 AM

    Re: Refreshing the page after upload

    Richard,
     
    Have you embed the uploader into form tag?
     
    Can you try the following example?
     
    1. <?php require_once "phpuploader/include_phpuploader.php" ?>  
    2. <html>  
    3. <head>  
    4.     <title>  
    5.         Form - Single File Upload   
    6.     </title>  
    7.     <link href="demo.css" rel="stylesheet" type="text/css" />  
    8. </head>  
    9. <body>  
    10.     <div class="demo">  
    11.                            
    12.         <h2>Single File Upload</h2>  
    13.         <p> A basic sample demonstrating the use of the Upload control.</p>  
    14.            
    15.         <!-- do not need enctype="multipart/form-data" -->  
    16.         <form id="form1" method="POST">  
    17.             <?php  
    18.   
    19.             $uploader=new PhpUploader();   
    20.             $uploader->MaxSizeKB=10240;   
    21.             $uploader->MultipleFilesUpload=false;   
    22.             $uploader->Name="myuploader";   
    23.             $uploader->InsertText="Upload File (Max 10M)";   
    24.             $uploader->Render();   
    25.   
    26.             ?>  
    27.         </form>  
    28.            
    29.         <br/><br/>  
    30.                
    31. <?php  
    32. $fileguid=@$_POST["myuploader"];   
    33. if($fileguid)   
    34. {   
    35.     $mvcfile=$uploader->GetUploadedFile($fileguid);   
    36.     if($mvcfile)   
    37.     {   
    38.         echo("<div style='font-family:Fixedsys'>");   
    39.         echo("Uploaded File:");   
    40.         echo("<br/>FileName : ");   
    41.         echo($mvcfile->FileName);   
    42.         echo("<br/>FileSize : ");   
    43.         echo($mvcfile->FileSize);   
    44.         echo("<br/>FilePath : ");   
    45.         echo($mvcfile->FilePath);   
    46.         echo("</div>");   
    47.            
    48.         //Moves the uploaded file to a new location.   
    49.         //$mvcfile->MoveTo("/uploads");   
    50.         //Copys the uploaded file to a new location.   
    51.         //$mvcfile->CopyTo("/uploads");   
    52.         //Deletes this instance.   
    53.         //$mvcfile->Delete();   
    54.     }   
    55. }   
    56. ?>  
    57.                            
    58.     </div>  
    59. </body>  
    60. </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 Complete Thread