function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
S PawarS Pawar 

Redirecting control to the same visual force page after uploading a file

Hi,

 

 

After uploading a file  using apex:inputFile tag of visualForce page i'm redirected to My Personal Documents.

But I want to redirect my control to the same visualforce page along with the message file uploded successfully

 

 

 

Thanks,

Sagar

gautam_singhgautam_singh

Hi,

 

 

You can use the PagrReference Class ..

 <script>
     function redirect(){
        window.location.href='http://www/google.com'; 
     }
   
 </script>
 window.onload = window.setTimeout(redirect(),5000);

 

You can use javascript code for passing parameter while redirecting. ..

public PageRefernce SaveRedirect{

insert document;
PageReference pg = new PageReference('/apex/thankyoupage');
pg.setRedirect(true);

return pg;
}

 

Important :

Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thank You

Deepak Kumar ShyoranDeepak Kumar Shyoran

Hi S Pawar ,

 

You can also prevent to redirect your page by setting the reRender attribute to "none"  in your action function that will also prevent to redirect your page on Document page.

 

 

If this post helps you then hit kudus by clicking on star and accept my post as a solution to your question.