Help with file upload and database information table...
Posted: Wed Oct 06, 2004 5:29 am
Hi there,
Sorry to keep on being a pain to everyone but I now have another question.
I have found what I think to be an excellent File Upload script at http://www.qto.com/fm/index.htm but would like to modify it in a couple of ways.
1 - I would like the username and password to be checked against a database table
The table would be called users and would have columns named :
A - id (Auto incrementing)
B - userName
C - password - (Using MD5 - I hope!!)
D - uploadFolder (Main folder for uploads)
However what I would like to be able to do (as I work in Flash and not HTML) is be able to verify a userName and password using Flash and PHP and if the supplied information is correct they will be logged into the system. I would then allow people to update information in a database and then if they would like to upload files if they then press on a button in the Flash movie and it would bring up this kind of script, however I would need the script to be generic as in I don't want to have to have the PHP file located in every users folder to allow them to use it. I would like to be able to pass the uploadFolder from Flash once they have been successfully logged in and then use this from within the file uploader to allow it to find the main folder.
I would then have four or so different folders within the hierarchy structure of say mp3, images, text and docs so that they can upload to different folders different types of files. I would then like to have some way of only allowing certain types of files into certain folders as Flash will then be loading in these files and if the wrong type of file is in the wrong folder then Flash could throw a wobbly!!
There is then a second part to all of this and I have absolutely no idea how to go about implementing this one.
I would like to be able to once a user has uploaded all the files that they want to is click on a button and be taken to a table styled layout of files they have uploaded and be able to choose a section for them to be listed in. Let's say that they upload three mp3 files and they want one of them to go into a section called main one into a section called gallery and one into a section called other then they would see the uploaded file names and using a dropdown be able to select the categoury. This would then be used to update a table in a database.
I was thinking that this might be even easier if the whole upload / table creation was put into one operation so they :
A - Login in Flash
B - uploadFolder variable is passed to a generic PHP script
C - Script queries a table in the database for all files previously uploaded by the user (if there are any).
D - Display information and allow categoury selection.
E - Update information or,
F - Upload a file into a certain folder (with file type checks) and choose categoury at same time and then refresh the table view in HTML. Also to go along with this if there could also be a delete file button which not only deletes the file from the server but also deletes the entry for that specific file in the database table.
I would still need the part in the script where it limits how much space they are allowed to upload to though.
I am sorry for such a long and involved post but if anyone can help me out with this then I would be in eternal debt to you.
Regards,
Mark Bowen
Sorry to keep on being a pain to everyone but I now have another question.
I have found what I think to be an excellent File Upload script at http://www.qto.com/fm/index.htm but would like to modify it in a couple of ways.
1 - I would like the username and password to be checked against a database table
The table would be called users and would have columns named :
A - id (Auto incrementing)
B - userName
C - password - (Using MD5 - I hope!!)
D - uploadFolder (Main folder for uploads)
However what I would like to be able to do (as I work in Flash and not HTML) is be able to verify a userName and password using Flash and PHP and if the supplied information is correct they will be logged into the system. I would then allow people to update information in a database and then if they would like to upload files if they then press on a button in the Flash movie and it would bring up this kind of script, however I would need the script to be generic as in I don't want to have to have the PHP file located in every users folder to allow them to use it. I would like to be able to pass the uploadFolder from Flash once they have been successfully logged in and then use this from within the file uploader to allow it to find the main folder.
I would then have four or so different folders within the hierarchy structure of say mp3, images, text and docs so that they can upload to different folders different types of files. I would then like to have some way of only allowing certain types of files into certain folders as Flash will then be loading in these files and if the wrong type of file is in the wrong folder then Flash could throw a wobbly!!
There is then a second part to all of this and I have absolutely no idea how to go about implementing this one.
I would like to be able to once a user has uploaded all the files that they want to is click on a button and be taken to a table styled layout of files they have uploaded and be able to choose a section for them to be listed in. Let's say that they upload three mp3 files and they want one of them to go into a section called main one into a section called gallery and one into a section called other then they would see the uploaded file names and using a dropdown be able to select the categoury. This would then be used to update a table in a database.
I was thinking that this might be even easier if the whole upload / table creation was put into one operation so they :
A - Login in Flash
B - uploadFolder variable is passed to a generic PHP script
C - Script queries a table in the database for all files previously uploaded by the user (if there are any).
D - Display information and allow categoury selection.
E - Update information or,
F - Upload a file into a certain folder (with file type checks) and choose categoury at same time and then refresh the table view in HTML. Also to go along with this if there could also be a delete file button which not only deletes the file from the server but also deletes the entry for that specific file in the database table.
I would still need the part in the script where it limits how much space they are allowed to upload to though.
I am sorry for such a long and involved post but if anyone can help me out with this then I would be in eternal debt to you.
Regards,
Mark Bowen