I am using form post and php to handle uploading the images, documents. Rename, delete etc. will also handle through php.
When the documents / images uploading, rename, deleting through php, I also update the database information at the same time.
It works out fine in 98% cases in my projects (they are not for the documents or images management business. documents and images are attachments to the articls or product description etc.).
There are other 2% situations not working well: large number of documents to upload, large size document to upload.
1) when I have large number documents and images to upload, then the form post / php upload scripts are too slow. This usually happens when we set up the inital site. I solved it by ftp the documents and images to the site and write a special script to initial set up the database for these ftp uploaded documents/images, rename, relocate these documents if needed (there are not too many database issues to take care in the initial time). Problem solved. But still, after the initial set up, then we have to handle the new uploads through the form post and php, so we can update the database. Meaning, after the site set up, if there are large amount new documents and images to upload to the sever and assign these documents and images to certain item (attach to certain products, news articles etc), we still have to do it throught the slow method of post and php handling.
2) if the document size is too big, then the form post / php upload won't work. Not just too slow, it is also limited by the max_size of the server allows. Plus, it will use a lot of server resouces when it is uploading.
My questions:
So how do you deal with the large number documents to upload or large size documents to upload cases and at the same time, you want these uploading doucments to be recorded and linked in the database different tables?
I can see two approaches
1) Some people said, in these cases, we have to use java to upload etc. Even we use java, we still have to use php to mange the database information about these uploading documents. So how java and php work together here? Any experience to share? Any 3rd party software to recommend?
2) I have another solution, for the large amount documents or large size documents, I will ftp them to a temporary location. And then write a set of scripts to deal with tasks about attach these documents to certain items (such as products, news articles), move these documents to the right location and remove it from the temp ftp locations. This way, we reduce the file upload time and resource used by ftp. But instead of simple click to attach an image or document to an article or product, we have to take extra steps. Go to the temp locations and pick the document and attach it to the right item(article or product) etc. Plus, there are a lot of situations to handle, attach to article, attach to product, attach to account etc. every situation need a script to handle.
Which approach should I use? I haven't tried the approach 1 java solution. So I cannot tell which is better.
What else you can recommend?
Given the situations that 98% cases we are fine with form post and php upload script. Only rares cases I need another approach. So I don't want a too expensive solution for these small percentage rare cases.
thanks!