File manipulation is used on the web to allow site visitors to download an offline version of the information presented, for effective document management or just to offer some files to others. Dynamic sites cover file manipulation quite nicely, allowing file uploading and changing on the fly, as well as a better control over downloaded / uploaded files.
Downloading files is the easy part, you just need to add a link to your page pointing to the file's location on the server, and when any visitor clicks that link, he can download the file.
Uploading is a little trickier. To upload a file directly from the browser to a server, you must use a form containing a file field. Also, the form must have the enctype attribute set to "multipart/form-data", in order to instruct the web server to download the submitted file to the server. When the page is submitted, the browser will read the file contents along with the other form fields and post it to the server.
The page to which the form submits will initialize some variables containing the file name, size and the remote upload folder. These variables have different names, depending on the web server you use, but their function is similar. To find what the specific names for this variables are for your particular configuration, consult the manual of the server, the file manipulation section.
Once the browser sent the file and the page initialized the variables, it is up to the programmer's code to handle how and where to store the file, to decide if it will be saved or discarded, inserted into a database or not.
When you work with files, you should take into account the following issues:
Another issue regarding file upload is recording the file into a database. Most dynamic web applications not only upload the file, but also record each file in a database. When the file record is deleted from the database, the corresponding file must also be physically removed from the server. Otherwise, old files will just pile up on your server, taking up valuable space.
MX Kollection 3 solves all of these problems in a simple, yet effective way, providing visual solutions to add code for file upload, download and delete.