This is kind of an adventure, I’ve decided that I should do a (programming) project, and in passing I made a list of goals for this project;
Basically I want to upload files to my site for storage as I don’t have access to other means of electronically transporting and managing files from school. By the end of the next five days this will be functional and meet the above specifications.
First off, I should mention that I will be using Espresso by MacRabbit (my favorite!), Transmit (also my favorite!) and my Dreamhost Server. Over the next five days I’ll be posting code updates and will ultimately post all of the code; this will be my first open-source contribution (even without a formal license).
So let’s get crackin’
So I have the database setup as used the following lines
`id` INT( 10 ) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT , `sc` VARCHAR( 25 ) NOT NULL , `goto` LONGTEXT NOT NULL , `dc` INT( 10 ) NOT NULL , `dlu` INT( 10 ) NOT NULL , `user` INT( 3 ) NOT NULL , `views` INT( 15 ) NOT NULL , PRIMARY KEY ( `id` )
and the ursers table:
`id` INT( 3 ) NOT NULL , `name` VARCHAR( 15 ) NOT NULL , `password` VARCHAR( 40 ) NOT NULL , `ip` VARCHAR( 15 ) NOT NULL , `dj` INT( 10 ) NOT NULL , `lli` INT( 10 ) NOT NULL , PRIMARY KEY ( `id` )
and the files:
`id` INT( 10 ) NOT NULL AUTO_INCREMENT , `f_name` VARCHAR( 100 ) NOT NULL , `f_size` INT( 20 ) NOT NULL , `dt` INT( 10 ) NOT NULL , `ip` VARCHAR( 10 ) NOT NULL , `sc` VARCHAR( 25 ) NOT NULL , `revision` INT( 2 ) NOT NULL , `comment` VARCHAR( 140 ) NOT NULL , `user` INT( 3 ) NOT NULL , PRIMARY KEY ( `id` )
So now all of the databases are setup. Let’s work on some underlying subroutines I’ll be using (these have been adapted from some of the code I’ve worked on before). These can be seen here, subs.pl.
As this is open on a second monitor, I will write later (syn. tomorrow) about my general writing technique for this project. Now that I have some groundwork done, I can get some work done. My first victim is upload.pl; I have to establish the pipeline before I can delve into the interesting work, ie the lists.
Go to BradArsenault.com/code/perl-uploader for more updates on this project.