Author |
Topic |
Michael Schmidt
Starting Member
23 Posts |
Posted - 13 July 2002 : 19:42:16
|
dayve, i think you're misusing the Right(string, int) function. for example
Right(".longextension",4) returns: "sion"
and
Right(".zip",4) returns: ".zip"
the only situation Right(extension,4) would return "." would be files with no extensions but which end with a period.
extension = LCase(Mid(filename,InStrRev(filename,".")))
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.
later!
Mike
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 13 July 2002 : 20:36:31
|
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.
http://www.nineinchnailz.com
Edited by - dayve on 13 July 2002 20:43:00 |
|
|
Michael Schmidt
Starting Member
23 Posts |
Posted - 14 July 2002 : 23:19:39
|
if right(extension,4) <> "." then response.write "sorry, only 3 letter extensions allowed"
this code does not enforce 3 letter extensions. I think what you meant to type was:
if Mid(Right(extension,4),1,1) <> "." Then response.write "sorry, only 3 letter extensions allowed"
just trying to help etymon if he is still using this method.
Mike
Edited by - Michael Schmidt on 14 July 2002 23:35:05 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
|
antracit
Starting Member
Sweden
33 Posts |
Posted - 15 July 2002 : 07:34:30
|
Hi
First a big thanks to all developers at Snitz!!
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).
JS
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 15 July 2002 : 13:21:41
|
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
http://www.nineinchnailz.com |
|
|
XavierSlater
Junior Member
United Kingdom
137 Posts |
Posted - 15 July 2002 : 13:40:53
|
Dayve, yer crazy.
There you go, dutifully obliged...
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.
Thoughts?
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 15 July 2002 : 17:04:24
|
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.
http://www.nineinchnailz.com |
|
|
XavierSlater
Junior Member
United Kingdom
137 Posts |
Posted - 15 July 2002 : 17:07:55
|
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.
Regards,
Stuart
|
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 15 July 2002 : 17:08:49
|
dayve, are those changes in the files you have posted a link to above? |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 16 July 2002 : 22:39:14
|
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.
here is my uploadengine.asp
http://dayve.d2g.com/forum/display_source.asp?page=uploadengine.asp
http://www.nineinchnailz.com
Edited by - dayve on 16 July 2002 22:51:10 |
|
|
ve3sjk
Starting Member
3 Posts |
Posted - 17 July 2002 : 12:37:35
|
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.
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 17 July 2002 : 14:37:52
|
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
http://www.nineinchnailz.com |
|
|
ve3sjk
Starting Member
3 Posts |
Posted - 17 July 2002 : 17:00:22
|
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.
Thanks, Steve
|
|
|
burthold
Junior Member
USA
426 Posts |
Posted - 23 July 2002 : 20:13:44
|
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.
Wes
|
|
|
Topic |
|