Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Mike's File Attachment Mod for Snitz
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 15

Michael Schmidt
Starting Member

23 Posts

Posted - 08 July 2002 :  13:46:50  Show Profile  Visit Michael Schmidt's Homepage  Send Michael Schmidt an AOL message  Send Michael Schmidt an ICQ Message  Send Michael Schmidt a Yahoo! Message
Here's a mod i have made. File attachment mods are pretty scarce so hopefully many of you will find this useful. Here's the link:

http://www.cornellreview.org/images/mikes_file_attachment_for_snitz.zip

Should be easy to install, (only edit one file in one place).

There are no external components required. The upload is pure ASP.

Good luck!

Mike

Keywords: File, Attach, Attachment, Upload, Paper, Clip

--------------------------- New: --------------------------------

UPDATE:
David Greening aka 'Classicmotorcycling' has updated and enhanced this mod to work for future versions of snitz (3.4 and above). The latest version can be found at http://www.snitzbitz.com/mods/details.asp?Version=All&mid=67. also be sure to check the end of this thread for more update info.

UPDATE:
Thanks to some work by 'BritishAndy', it appears that the uploading does not work on big-endian machines. So, if your server is for example running Chilisoft on a Solaris server, you may experience problems with the current mod version. But the vast majority of servers running ASP are windows machines which are little-endian and work fine.

thank you everyone for your support and email. later!

Mike

Edited by - Michael Schmidt on 14 January 2003 16:23:41

dayve
Forum Moderator

USA
5820 Posts

Posted - 08 July 2002 :  16:47:53  Show Profile  Visit dayve's Homepage
got a demo and/or more info on this? does it create a member directory like the one HuwR made?


http://www.nineinchnailz.com
Go to Top of Page

Michael Schmidt
Starting Member

23 Posts

Posted - 08 July 2002 :  17:06:30  Show Profile  Visit Michael Schmidt's Homepage  Send Michael Schmidt an AOL message  Send Michael Schmidt an ICQ Message  Send Michael Schmidt a Yahoo! Message
Mine is running on the intranet so no i dont have a demo available. Here are a couple screenies:

http://www.cornellreview.org/images/post.gif

http://www.cornellreview.org/images/new_post.gif

Mike

Go to Top of Page

Etymon
Advanced Member

United States
2383 Posts

Posted - 08 July 2002 :  18:17:24  Show Profile  Visit Etymon's Homepage
Hi Mike,

Thanks for the MOD!

Does your MOD have the ability to determine the kilobyte size, dimensions, or type of the file and either accept or reject the file ... perhaps sending a message to the poster in a popup window stating the parameters of the attempted file and what the acceptable parameters are for that forum?

Your work looks great though! Good job! Will download it and try it out when I get home. Thanks again!


Cheers,

Etymon


Edited by - Etymon on 08 July 2002 18:24:06
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 08 July 2002 :  20:53:04  Show Profile  Visit dayve's Homepage
you should give the ability to show the image in the thread instead of a link to it, this is how HuwR's version works.

I would also question if you could filter file types and sizes, otherwise you are giving people the ability to upload an asp script and execute it on your server!!


http://www.nineinchnailz.com
Go to Top of Page

Etymon
Advanced Member

United States
2383 Posts

Posted - 08 July 2002 :  22:00:38  Show Profile  Visit Etymon's Homepage
quote:


I would also question if you could filter file types and sizes, otherwise you are giving people the ability to upload an asp script and execute it on your server!!




I don't know even to know where to begin to understand how to upload a script and execute it this way.

What I am thinking about is like disallowing a heavy image like above 30K, disallowing a monsterous file dimension like 300 x 1500, and distinguishing if the file is only certain file formats like .jpg or .gif instead of tif and the like.

Is there a resource where I can learn more about the vulnerability you are talking about dayve? I really don't understand what you mean. Thanks though.

Etymon

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 08 July 2002 :  22:18:25  Show Profile  Visit dayve's Homepage
HuwR's upload mod gives you a simple control panel to limit the file size and allowable file extensions.



if somone is able to upload a server side script then they have access to a lot of things like reading databases, directories, source code, etc... its just the nature of ASP, unless you take precautions like turning off EXECUTE in the upload directories and limiting what file types are allowed.


http://www.nineinchnailz.com
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 08 July 2002 :  22:56:34  Show Profile
Dayve,

I played with the code, and it is easy to make it show the image in the post. Thanks for the idea. I am going to adjust so it only allows for the up load of images, just got to work this out.

quote:

you should give the ability to show the image in the thread instead of a link to it, this is how HuwR's version works.



Apart from that, it is a great mod. Easy to install.

I put it at my other site, www.davidgreening.com for testing in the forums.

Cheers,

David
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20580 Posts

Posted - 09 July 2002 :  05:55:10  Show Profile  Visit HuwR's Homepage
there is a section in the code that checks the file extensions in outpufile.asp find this code


' --- CHECK FILE FOR ACCEPTABILITY ---
extension = LCase(Mid(filename,InStrRev(filename,".")))
If _
extension <> ".asp" And _
extension <> ".cgi" And _
extension <> ".pl" And _
extension <> ".php" And _
extension <> ".vbs" And _
extension <> ".vbx" And _
extension <> ".scr" And _
extension <> ".js" And _
extension <> ".com" And _
extension <> ".bat" And _
byteCount <= 50000000 _
Then

which filters out naughty files

Go to Top of Page

Fury
New Member

USA
62 Posts

Posted - 09 July 2002 :  21:22:34  Show Profile
HuwR,

What line of code don't you know? My first thought when I looked at your code was, hmmm what if I made the file name virus.jpg.asp. Then it would pass right through your check. Then I noticed the InStrRev. I had never seen that function before. That reverse certainly solves the problem.

Amazed as always.

Go to Top of Page

Etymon
Advanced Member

United States
2383 Posts

Posted - 09 July 2002 :  21:50:40  Show Profile  Visit Etymon's Homepage
Thanks for all of the help!

How things are executed and automated still has my jaw dropped to the floor. It's nice to have folks who can toss me a pillow while I learn from them how to pick myself up!



Edited by - Etymon on 09 July 2002 21:51:44
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 09 July 2002 :  21:53:56  Show Profile  Visit dayve's Homepage
quote:

Then I noticed the InStrRev.



when I check for extensions I generally use right(strField,3)


http://www.nineinchnailz.com
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 09 July 2002 :  22:20:30  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
quote:

quote:

Then I noticed the InStrRev.



when I check for extensions I generally use right(strField,3)


http://www.nineinchnailz.com



.js and .pl are only 2 letter extensions

Brad
Web Hosting with SQL Server @ $24.95 per month
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 09 July 2002 :  22:28:12  Show Profile  Visit dayve's Homepage
quote:


I put it at my other site, www.davidgreening.com for testing in the forums.

Cheers,

David



did you modify it to upload into a member's directory instead of a generic directory? I am getting ready to do that now just so I can test this script. I'm very interested in seeing how it handles large file sizes since that has been most of my problems with the one I am using now. it seems to crap out if I upload files larger than 3-4 megs . I know somone mentioned to use a component driven version for uploading but I'd rather check out all pure asp versions first.

www.nineinchnailz.com" target="_blank">www.nineinchnailz.com/forum/uploaded/dayve/snitz_award_flag.gif" border=0>
www.nineinchnailz.com" target="_blank">http://www.nineinchnailz.com
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 09 July 2002 :  22:45:14  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
dave the problem with uploading large files like that is the script timeing out on the server. i wouldnt think that uploading a 3-4 meg file in a pure asp upload would cause any problems. its basically the exact same thing from what i have seen.

Brad
Web Hosting with SQL Server @ $24.95 per month
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 10 July 2002 :  01:14:28  Show Profile
Dayve,

I only allow images to go in to a generic directory that only the uploads got to away from the general population.

Also had to make it so that only registered users would be able to upload their images. (Had heaps of people trying to upload) It was real easy to implement as I am sure you will be able to do and make it better.

quote:

did you modify it to upload into a member's directory instead of a generic directory? I am getting ready to do that now just so I can test this script. I'm very interested in seeing how it handles large file sizes since that has been most of my problems with the one I am using now. it seems to crap out if I upload files larger than 3-4 megs . I know somone mentioned to use a component driven version for uploading but I'd rather check out all pure asp versions first.



Works great as well.

Cheers,

David
Go to Top of Page
Page: of 15 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07