Page 1 of 1

A push in the right direction

Posted: Sat Jun 21, 2008 11:08 am
by capop
Hello users of devnetwork.
I am new to php and have had a few ideas but need a push in the right direction as to whether I can do the things I want with php and where to find guides on how to do them.

Firstly:
A script that allows the user to upload up to 10 files, using a folder browser with multi file select, not using 10 upload boxes. An example of what I mean is at http://www.fatalpain.com/multi_upload.PNG

These files, once upload should all go into the same folder.
Then, the file name should be enterned into the database table. Currently, I have managed to get the directory and file name to save into a database but only using a single upload script. How could I make a multi select upload script saves data to a cetrain folder and updates the database fully as well as removing the directory information (Removing all data before and including the final '/' before the file name)?

Secondly:
As a security measure for the above, I would like there to be only 1 type of file (extention) allowed to be uploaded with a size limit. Also, the file name needs to follow a basis of 'Word or more all starting with capital then space - space Word or more all beginning with capital dot. extension. Eg = Chapter One - Philosophy.pdf. If a user does not use a dash in there file, display an error telling them how it should be done. If they follow the space - space .extension basis, there file name should be auto capitalised. Eg. Chapter One Philosophy.pdf = Error. chapter one - Philiosophy.pdf = Auto correct to Chapter One - Philosophy.pdf. I have not made any progress on this from of read input and chnaging them. I hope you can help me with this.

Thirdly:
As my database fills, every day, I would like it to output a file containing data from within it. The file should follow the following basis.
Eg.

Code: Select all

 
Database output
Customizable text Here
 
Database Item 1: Chapter One - Philosophy.pdf
Database Item 2: Name
Database Item 3: Name
Database Item 4: Name
Database Item 5: Name
 
More customizable text here
 
The file should be generated every day and replace its old version. The file should have the extention .mnzt. Also, if possible but not nessecary, a timer that says how long until the next file update is, viewable on a web page would be nice if you could point me in the direction of doing this.

Thankyou for reading this far. I am willing to learn so tutorials would be wonderful but even if you can only post a quick tip, it would be much appreciated. Once this task is complete, I aim to learn php to a much fuller extent but I currently need to finish this. Please ask me any questions if you do not understand what I am trying to achieve.

Thanks for your replies.

Re: A push in the right direction

Posted: Sat Jun 21, 2008 11:55 am
by califdon
You can certainly do all that with PHP scripting. It's hard to think of anything you might want to do, server-side, that you can't do with PHP.

There are countless online tutorials on uploading multiple files. For example, http://www.phpeasystep.com/workshopview.php?id=2. While I am not criticizing you for posting here, you could probably gain far more understanding more quickly by using Google or any search engine, using search words like: php upload multiple files. Another great resource is http://w3schools.com.

Personally, I would not use filenames with embedded spaces, since different file systems handle them differently. Among other problems, some of your users might download files which their operating system might not properly recognize. You might want to use underscore characters, which could be replaced with spaces for displaying, if required. My strong preference is to not use any special characters or uppercase in filenames.

The remainder of your questions are details of coding that you can introduce here as questions as you reach the point in your programming where you have the beginnings of a script. We can help you resolve them, one by one. But there is no doubt that all are quite routine operations in PHP.

Re: A push in the right direction

Posted: Sat Jun 21, 2008 12:09 pm
by capop
Thanks for your help.
While searching google, I had alot of trouble because there are many guides on using multiple <input type=file... boxes as a multiple uploader like so http://www.phpeasystep.com/workshopview.php?id=2. However, I have managed to find a very good guide which is showing me how to extract just the file name and now I am currently manipulating this for my own use. As for your meantion on special characters, I have done a bit of googling and will follow you idea of using underscore's and then replacing them with spaces at a later date. It seems a safer, all browser supported idea.

I will post again with my progress. Thankyou again to califdon.