always equals everything after and including the last period in the filename.
Also I do agree having a list of accepted file types would be better than a list of blocked file types for public servers. But for a trustworthy lan environment I perfer to have it as hinder-free as possible.
quote: dayve, i think you're misusing the Right(string, int) function. for example
Right(".longextension",4) returns: "sion"
and
Right(".zip",4) returns: ".zip"
LOL, I don't think you are reading my post clearly... I wrote...
if right(extension,4) <> "." then response.write "sorry, only 3 letter extensions allowed"
I am NOT using this, I was just showing an example but it clearly shows that I am using it to enforce 3 character extensions ONLY as Etymon had asked:
Etymon asked "In the code, is there a way to add a wild card to an extension? For example, if I want to accept a three letter .jpg extension and nothing longer, how do I tell it to accept just only .jpg?"
quote: But for a trustworthy lan environment I perfer to have it as hinder-free as possible.
I am a LAN administrator as well, but not sure what you mean by this? As a LAN administrator in charge of a FIREWALL you close ALL HOLES and punch ALLOWED holes.. this is the BEST approach and extremely hinder free once it is set up correctly.
yes you are right mike on this, I forgot the mid part.
I am still not in agreement though with the allow/disallow routine though. I think it is best to disallow all and then enter in the code file types allowed.
btw, anyone wanting to use this asp upload in combination with individual member directories, here is the source code I am using:
My subject; Just tried this asp upload with folder-creating. Works perfect! I’m not to good with asp but have been using SnitzForums for a while. Now I’m wondering if there is a way to combine this upload with a function where you assign members to be able or not able to upload these files. I think there would bee some adding to the database?
HuwR's upload got something like that, where you turn on/off upload abilities at the Forum, but not depending on membership (I think).
antracit, call me crazy but I am reinventing the wheel here. I have taken what Mike has found along with what HuwR has developed in the past and will be implementing features like the one you just mentioned. So far on my to do list is:
1. Control Panel for filtering file types and sizes. 2. Member control for allowable uploads and downloads.
For the record I have been able to use HuwR's upload mod on 3.3 and it works just fine so instead of using this version, you may want to use HuwR's which encapsulates all the features you are probably looking for. I am just tweaking this one because its fun to go through all the hurdles of taking "base" code and slowly customizing it to integrate nicely with Snitz. Call me crazy.. but it is fun
What I would be interested in is an amalgam of the File upload, and the User Groups mod, so you could assign rights to groups, and folders to groups and such like.
I am not using the User Groups Mod (didn't even know there was one completed) but that is a good idea. I will keep the idea written down but will concentrate the basics of the mod first. I have found a bug with this script that also exists in HuwR's mod that allows ANYONE to upload images into and over existing files in other members directories. I have fixed that in this version as well as HuwR's version and will email HuwR to see if he is aware of it.
Been exchanging mails with Morpheus73 today on the usergroups MOD, its bee shelved for the meantime, he has a work in progress that is quite spanky.
I am running one of the alpha versions on a site, but I want to expand it beyond controlling forum access, and using it to backbone some content delivery systems.
Sadly I am all ideas, and no skillset atm.
The file library thing, with a Usergroup model controlling access would make a HUGE difference to a project I am currently working on, or been tasked with.
quote: dayve, are those changes in the files you have posted a link to above?
I believe so. the issue with uploadengine.asp is this line
strFolder = objUpload.Form.Item("Folder")
I have changed it to
strFolder = strDBNTUsername
and I did something similar to the files for this mod in outputfile.asp, you'll see it in the source. let me know if you have any questions... I have a friend that had some issues using the objUpload.Form.Item.
I uploaded and installed the files as per instructions, when I go to the file upload in the forums on my server and give it a file name and press upload I get an internal server error 500.
quote: I uploaded and installed the files as per instructions, when I go to the file upload in the forums on my server and give it a file name and press upload I get an internal server error 500.
you need to give WRITE permissions to the uploaded directory and make it inheritable
Got it working, works great.....kudos to the writers.....
Here is a question,
how hard would it be to create a log file of the users ip address when a file is downloaded. What I have is a private forum that only certain user can access, I guess I'am looking for a way of knowing if a user gives his access to someone else(ie different ip). Almost like an ip based security that only allows a user to access the download from the ip address he used to register to the forum.
In my photo album I regulate uploads to just jpegs I do this by looking at the file ext and the file type sent from the browser i.e. image/pjpeg. I tried to rename files to diffrent ext i.e. zip files to jpg gif to jpg etc etc and it seems to catch them and kick them back every time. I also have file size limits that are admin controled. I may put in an option to choose what kind of image files are allowed. I chose jpg because it is usually the smaller and most distributed of image types.