How do I replace my uploader web page with my processed results?

Paul Pruitt June 30, 2011
Pinterest Stumbleupon Whatsapp

I’m using Valum’s Ajax Upload and sending it to a PHP server file. The web service I wish to provide is an extractor of text from MS Office files. I have been able to get the uploader working on a Windows shared hosting server and been also able to get the text extraction running. The problem is writing a link pointing to the results back to the upload page or simply displaying the text results in the browser. How do you do that?

What I’m doing as a work around currently is having a second form and submit button which launches a second php file which displays the resulting text file inline. That’s no problem. I used sessions to get the file name from uploaded server php.php file. I was hoping however that once the file was uploaded it would automatically launch the text file which would replace the uploader page, or just use Ajax to write a link to the results on the upload page. So how does one do this basic thing?

Ads by Google

  1. Bruce Epper
    July 2, 2011 at 2:12 am

    If the text extraction is generating a temporary file of some sort, you can ensure that it has an .htm or .html extension and just redirect to that as the next page after the extraction completes.  No need for extra buttons or forms.  Or you could just add the code from your second php file to the original after the extraction occurs to push the results to the user.

    I guess it all depends on exactly how you are doing this right now, how much effort you want to put into the next mods and how much harder it will be to maintain the code.