CodeIgniter Forums
Upload file, process in background, present status - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Upload file, process in background, present status (/showthread.php?tid=46802)



Upload file, process in background, present status - El Forum - 11-15-2011

[eluser]Unknown[/eluser]
Hello,

What's BCP on uploading files in CI and processing them in the background?

I need a fairly simple way to deal with long running jobs, and only need one job at a time to be processed since this is part of the backend/admin side of the site.

This is essentially what I'm looking for...

-User visits http://foo.com/admin/upload and is presented with a standard upload form
-User selects file, posts form.
-Our existing form checks verify the file is correctly formatted or presents user with an error, nothing is queued.
-If the file is OK, it is saved to a temporary location and another php script is called to process the file
-User is redirected to http://foo.com/admin/upload/status, if the job is still running, they are notified of that, if the job is done, they are shown the results (php script has output stdout to a text file)
-If the user returns to http://foo.com/admin/upload and a job is still runing, they are redirected to http://foo.com/admin/upload

What in the CI framework would be of use to me here?