Jump to content

Long PHP task


vbCrLf

Recommended Posts

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.

Link to comment
Share on other sites

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  :-\

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.