How do I check if an html file was generated in ftp and if it was generated, open it in the browser?

0

I have a form, after completing and sending the form, a csv file is generated with the data of the form, the file is sent to an application on the server where it makes the necessary calculations and generates a html file in one folder no ftp , I would like to know how to check if the html file was generated and if it was generated, open it in the browser on the same tab as the form I submitted.

The file csv and the file html will have the same name.

while (!file_exists("$diretorio/$filehtm")) {
      sleep(1);
      header("Location: Link_Para_Ser_Redirecionado.htm");    
    }
    
asked by anonymous 08.05.2018 / 20:49

1 answer

0

Solution:

while (!file_exists(ftp://usuario:[email protected]/diretorio/arquivo)) sleep(1); //O sleep serve como intervalo no loop
    header("Location: http://link_para_ser_redirecionado.com"); 
    
15.05.2018 / 18:15