vbCrLf Posted January 4, 2008 Share Posted January 4, 2008 Hello, In my project the user upload a file, the server processing it (converting, etc) and add it to the database. The problem is that when the user press upload, he have to wait until the whole process has finished. So, I thought about doing it like this: 1. The user upload a file. 2. The user can close the window or move to other page, while the server (PHP) processing the file. 3. Later, when finished, PHP updates the db/files/etc. But the problem is... I don't know how to do it. Any ideas? vbCrLf. Quote Link to comment https://forums.phpfreaks.com/topic/84438-long-php-task/ Share on other sites More sharing options...
SuperBlue Posted January 4, 2008 Share Posted January 4, 2008 Hello, In my project the user upload a file, the server processing it (converting, etc) and add it to the database. The problem is that when the user press upload, he have to wait until the whole process has finished. So, I thought about doing it like this: 1. The user upload a file. 2. The user can close the window or move to other page, while the server (PHP) processing the file. 3. Later, when finished, PHP updates the db/files/etc. But the problem is... I don't know how to do it. Any ideas? vbCrLf. Im not really experianced in that area yet, but the only logical solution would be to display an Upload-bar, while the file is getting uploaded. I dont think it will effect the user in any way whatsoever, when the php script has recived the file; Meaning the user should be free to close the browser, as soon as the upload has finished, the server still finishes the script. This is bound to be done trough AJAX or Flash. The good thing about Flash is, that actionscript is easy to learn. Edit: And in general, i think its a matter of seconds or less after the upload, it shouldent take long to move/save a file. But i could be wrong :-\ Quote Link to comment https://forums.phpfreaks.com/topic/84438-long-php-task/#findComment-430115 Share on other sites More sharing options...
Ken2k7 Posted January 4, 2008 Share Posted January 4, 2008 Hello, In my project the user upload a file, the server processing it (converting, etc) and add it to the database. The problem is that when the user press upload, he have to wait until the whole process has finished. So, I thought about doing it like this: 1. The user upload a file. 2. The user can close the window or move to other page, while the server (PHP) processing the file. 3. Later, when finished, PHP updates the db/files/etc. But the problem is... I don't know how to do it. Any ideas? vbCrLf. Well the user should be able to MOVE to another page with no problem. Closing it would shut off connection. It's like I'm going to upload something and then shutdown my computer. How would PHP do anything about that? Quote Link to comment https://forums.phpfreaks.com/topic/84438-long-php-task/#findComment-430117 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.