Uploading files via php
Posted: Fri Nov 10, 2006 8:40 am
Hi,
I am working on uploading files (word, excel files etc.) via php. As I understand it, files can either be stored within (1) a database table (by using php's file_get_contents function), or (2) on a directory in the server. I assume, however, that the file_get_contents function can only be utilized for text files, as opposed to excel and word files, but please correct me if I am wrong.
Also, lets assume that the user attaches files as part of an input form whereby the user presses a file upload button after they have selected the files with the browse button(s). At that point, am I correct in assuming that I should store the files in a temporary upload directory and then only transfer them to their final resting place if the user actually submits the entire form. This makes sense to me; does it make sense to you?
I look forward to your thoughts.
Thanks!
I am working on uploading files (word, excel files etc.) via php. As I understand it, files can either be stored within (1) a database table (by using php's file_get_contents function), or (2) on a directory in the server. I assume, however, that the file_get_contents function can only be utilized for text files, as opposed to excel and word files, but please correct me if I am wrong.
Also, lets assume that the user attaches files as part of an input form whereby the user presses a file upload button after they have selected the files with the browse button(s). At that point, am I correct in assuming that I should store the files in a temporary upload directory and then only transfer them to their final resting place if the user actually submits the entire form. This makes sense to me; does it make sense to you?
I look forward to your thoughts.
Thanks!