Posted on: 06/30/02 04:54pm
By: squatty
I found this nifty little upload class that I thought might be worth sharing. The class allows you to specify what sort of files to accept (by mime type), the max file size, and includes a method for addressing duplicate files.
After some tweaking, I managed to get the class to play nice with Geeklog. You can see the class in action here[*1] .
In addition, I've packaged up a scaled down version of the example in the above link and placed it in my downloads section. You can get the code here[*2] .
forgot to mention...
Posted on: 07/01/02 05:49am
By: squatty
I added a bit of code to the "upload" form that will send an email to a specified user in the event of a new upload. I guess you could call it "upload notification" :-)
works well
Posted on: 07/02/02 01:38am
By: Anonymous (foniksonik)
I added this to my site and it works quite nicely. I also added a symlink to the uploads directory ala ../fileupload/uploads ==> files in public_html so people can just add a link like so <a href="files/[file_name_here]>file</a> to any article or comment.
I did comment out the e-mail notice code addition as it seems to slow down the script and makes it seem like the upload is taking longer than it is. My site is for employees only so i'm not overly concerned about notification of uploads though.
I'm curious as to whether you integrated this with the file download script you posted previously.
Last but not least, is the GL code in your version of upload.php enough to integrate this into the auth system for GL or is it just enough to get it to work?
I'll look into it myself but if you have a quick take on how much of an issue this could be i'd appreciate it.
Mostly because there are plenty of file browsers available for php that could be integrated for use as a file manager and if all I have to do is add the include for GL libs and some begin content block/end content block code it sounds fairly easy to do a file system type file manager.
Thanks for the reference and thanks in advance for any further enlightenment.
works well
Posted on: 07/02/02 06:23am
By: squatty
Like the symlink idea!
As for the integration, no I did not add the upload script to the download tool (paFileD
. That too would have been a nice addition. I simply added a link in the downloads section to the upload form….quick hack.
For the most part, my intent on posting this story was to provide a quick utility (class) for uploading files. The GL integration was an after thought. As you have come to notice, it is quite easy to "wrap" any bit of code within Geeklog. You simply need to make the appropriate calls to site header/footer and block start/end. The one gotcha with this is that not all code plays nicely with Geeklog and programs that have built-in security/authentication will need some work (often a lot!) to be truly integrated.
works well
Posted on: 07/02/02 12:13pm
By: Anonymous (foniksonik)
The symlink thing as a config string could work in a less-secure environment if you set up a variable path based on their username when they register.. ie: call the shell to make an individual folder for each user and then add a config path so that when they call 'files/[file_name]' 'files' gets replaced with [$username_files] or whatever. you could even hash or md5 it with their password for real security. Just some thoughts.
Upload Download scripts
Posted on: 07/10/02 04:12pm
By: Anonymous (foniksonik)
I found the upload download script here:
http://www.zachwhite.com/scripts.htm
to be more feature rich that the class suggested.
I have a fully integrated set of scripts available for any who are interested.
e-mail: [NOSPAM]jhatfieldATavamar.com[/NOSPAM]