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)
 proeder's File Attachment Mod 1.0
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 13

proeder
Junior Member

Australia
230 Posts

Posted - 05 February 2004 :  03:36:29  Show Profile  Visit proeder's Homepage  Reply with Quote
09.05.04 - Updated Zip File, link fixed, bugs fixed

(02.05.04: some writing errors in replace files...sorry, fixed)

This a improved version of Mike's File Attachment with a lot of included features worked out by Suhern. Thanks to him!

I built in some more nice features which make this now a real mod I believe:

  • Admin Panel to control all settings

  • File size, extensions, server timeout and uploadfolder configurable

  • Improved error listings, when files are not uploaded - no you know why!

  • Reusing previously uploaded files as easy as uploading a new one

  • In myfiles.asp users may delete files they don't want to use anymore

  • Admins can delete any file in any folder

  • Images are displayed in posts, when feature is turned on

  • Images are thumbnailed in myfiles.asp

  • dbs file and readme included

  • Two language versions: German and english


06.02.04:
  • script for checking invalid characters in filename added

For downloading the mod please follow the link or come to my demoforum
17.02.04:
  • Round function corrected
  • Readme updated
  • Images included
  • Images definded now in inc_iconfiles.asp
  • link in post.asp improved (mouseover with hand style
  • Icons for different file types in admin console added
  • dbs file now without error

For downloading the mod please follow the link or come to my demoforum
Download

[EDIT]IMAGES NOW INCLUDED!!!

Have fun!<

Looking for german Snitz forum? Suchst Du ein deutsches Snitz Forum?
Hier findest Du eins...

Hosting with ASP Support available: http://www.sharepointing.com

Edited by - proeder on 09 May 2004 05:51:27

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 05 February 2004 :  10:08:02  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Sounds good!! I'll try to integrate it into oxle!<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

NorwegianViking
Junior Member

Denmark
119 Posts

Posted - 05 February 2004 :  14:43:19  Show Profile  Visit NorwegianViking's Homepage  Reply with Quote
Ops!
Seems like you have included an unmodified post.asp.
I can't find any reference to your MOD in this.

In the documentation it states:
In your forum directory create a folder, name it however you want to and grant write access for anonymous access to this folder.

Does it HAVE to be in the Forum directory, or can it be at the same level as the Forum directory (as with the Database directory)?

Look forward to use this MOD.<

kind regards
NorwegianViking

Mod installation for beginners | User registration problems?
Go to Top of Page

proeder
Junior Member

Australia
230 Posts

Posted - 05 February 2004 :  20:57:29  Show Profile  Visit proeder's Homepage  Reply with Quote
First of all: Some changes.

  • I had problems with uploading files containing special characters in the filename, the script would set wrong links in the post then. I fixed that by adding the IsValidString function to the script.

  • Links were not set correctly in the post, fixed that as well
  • Some translations in myfiles.asp were not correct, fixed

  • post.asp did not have the code in it, fixed



The Zip is updated, the link above is fixed to point to the new Zip. Try again!

@NorwegianViking: Unfortunately yes, the uploadfolder needs to be in your forum directory (which certainly may be named different...). I did not find a way to put the uploadfolder elsewhere than in the forum dir as the original script alway uses the actual server mappath method to create the subfolders. I thought of changing that but did not know how to do that. But as I cannot see any disadvantage in using the forum dir I did not put too much effort in findeing a different solution. If there is any big disadvantage let me know, then we would need to find another way...


<

Looking for german Snitz forum? Suchst Du ein deutsches Snitz Forum?
Hier findest Du eins...

Hosting with ASP Support available: http://www.sharepointing.com
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 06 February 2004 :  00:59:00  Show Profile  Reply with Quote
I have placed this on my forum so Moderators and Admins are the only ones that can post attachments in thier posts. It looks so much better with the new interface.

Did find a couple of issues with the code in post.asp, but that soon fixed up, there was also an issue with the paperclip in the attachment inline. It could not find it, but after some playing about, got hat to work as well.

All up good work Proeder..
<

Cheers,

David Greening
Go to Top of Page

NorwegianViking
Junior Member

Denmark
119 Posts

Posted - 06 February 2004 :  01:24:46  Show Profile  Visit NorwegianViking's Homepage  Reply with Quote
Thanks Proeder

I'll try to implement again tonight.

Classic, would you share your findings?

The issue about the location of the folder:
The only "problem" got to do with implementing new MODs.

To test a new MOD, I create a new folder on the server where I place and test the complete forum with the files for a new MOD.
If I always have to have a read/write subdirectory to this, I must contact my ISP everytime I do a MOD. And do a LOT of file copying (files uploaded), because I want to switch to this new directory when I have tested the MOD.

Maybe someone else could give some advise on this?<

kind regards
NorwegianViking

Mod installation for beginners | User registration problems?
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 06 February 2004 :  02:29:45  Show Profile  Reply with Quote
Error in dbs:

quote:
CREATE TABLE FORUM_UPSIZE( ID int IDENTITY (1, 1) PRIMARY KEY NOT NULL , UPLOAD_VAR text (20) NULL , UPLOAD_VALUE int NULL )
CREATE TABLE FORUM_UPSIZE( ID int IDENTITY (1, 1) PRIMARY KEY NOT NULL , UPLOAD_VAR text (20) NULL , UPLOAD_VALUE int NULL )
9 | Subscript out of range


As for the paperclip icon issue, you need to add the following to the end of your icon list in "inc_iconfiles.asp":


Const strIconPaperClip = "icon_paperclip.gif|15|15"


Several lines in post.asp need to be modified, the following work:


     if strAllowAttachment = 1 then
	Response.Write	"<tr>" & vbNewLine & _
		        "<td bgColor=""" & strPopUpTableColor & """> </td>" & vbNewLine & _
		        "<td bgColor=""" & strPopUpTableColor & """ valign=""center"">" & vbNewLine & _
                        "        <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
			"		<a href=""#"" onClick=""window.open('pop_upload_new.asp','Uploading','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=800,height=330');""><acronym title=""Attach File..."">" & getCurrentIcon(strIconPaperClip,"","") & "</acronym></a><acronym title=""Attach File...""> <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>To attach a file, click here.</font></acronym><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """><br /></font>" & vbNewLine & _
			"</td>" & vbNewLine & _
		        "</tr>" & vbNewLine
     end if


Just a suggestion - the current method works, but it'd look better with the icons for each added filetype to be displayed with the file names in admin_attach.asp (vs current method of showing both a delete icon and the word delete).<

Edited by - Carefree on 06 February 2004 03:46:39
Go to Top of Page

proeder
Junior Member

Australia
230 Posts

Posted - 06 February 2004 :  02:57:23  Show Profile  Visit proeder's Homepage  Reply with Quote
Yes I 've seen that myself. Unfortunately I do not know where that comes from. Sorry. But it does not seem to have any bad effects - the tables are created correctly and the mod itself works. If anone knows where the error comes from, let me know. Here is the dbs code:

(most of it I just copied and pasted it from other dbs' I've found - I am not a Database expert...

Attachement Insert
[INSERT]
CONFIG_NEW
(C_VARIABLE,C_VALUE)#('STRALLOWATTACHMENT','1')
(C_VARIABLE,C_VALUE)#('STRUPLOADURL','')
[END]
[DROP]
UPSIZE
CONFIG_EXTENSION
[END]
[CREATE]
UPSIZE
ID
UPLOAD_VAR#VARCHAR (20)#NULL#
UPLOAD_VALUE#Int#NULL
[END]
[CREATE]
CONFIG_EXTENSION
ID
EXTENSION#VARCHAR (15)#NULL#
[END]
[INSERT]
UPSIZE
(UPLOAD_VAR,UPLOAD_VALUE)#('STRTIMEOUT','3600')
(UPLOAD_VAR,UPLOAD_VALUE)#('STRUPLOADFILESIZE','100000')
[END]


[edit 17.2.] FIXED

Have Fun!<

Looking for german Snitz forum? Suchst Du ein deutsches Snitz Forum?
Hier findest Du eins...

Hosting with ASP Support available: http://www.sharepointing.com

Edited by - proeder on 17 February 2004 00:37:07
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 06 February 2004 :  03:56:27  Show Profile  Reply with Quote
Strictly in the interests of accuracy (since KB/MB/GB are really in multiples of 1024 vs 1000), lines 90-96 of "pop_upload_new.asp" should be changed as follows:

	If strAllowedSize < 1024 Then
    		strAllowedSize = Round(strAllowedSize,2) & " Bytes"
  	ElseIf strAllowedSize < 1048576 Then
    		strAllowedSize = Round(strAllowedSize/1024,2) & " KB"
  	Else
    		strAllowedSize = Round(strAllowedSize/1048576,2) & " MB"
  	End If
<
Go to Top of Page

vmplanet
Junior Member

112 Posts

Posted - 08 February 2004 :  19:58:23  Show Profile  Reply with Quote
Question:

I read in your readme to make a dit in my forum dir. Problem i have is that my windows server is small. But i have a linux server with lot of space and datatraffic. I would like to set a folder on that server so not in the forum dir itself but on a totally different domain and server.

Is this possible?<
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 08 February 2004 :  22:43:53  Show Profile  Reply with Quote
No it is not possible.
quote:
Originally posted by vmplanet

I would like to set a folder on that server so not in the forum dir itself but on a totally different domain and server.

Is this possible?

The upload takes advantage of some of the windoze scripting and writes it to your hard drive. Linux doesn't support the type of Scripting that this mod requires/needs to operate. <

Cheers,

David Greening
Go to Top of Page

proeder
Junior Member

Australia
230 Posts

Posted - 10 February 2004 :  20:30:51  Show Profile  Visit proeder's Homepage  Reply with Quote
So it is...<

Looking for german Snitz forum? Suchst Du ein deutsches Snitz Forum?
Hier findest Du eins...

Hosting with ASP Support available: http://www.sharepointing.com
Go to Top of Page

AWD_ENVY
Junior Member

103 Posts

Posted - 11 February 2004 :  15:04:53  Show Profile  Reply with Quote
quote:
Originally posted by Classicmotorcycling

No it is not possible.
quote:
Originally posted by vmplanet

I would like to set a folder on that server so not in the forum dir itself but on a totally different domain and server.

Is this possible?

The upload takes advantage of some of the windoze scripting and writes it to your hard drive. Linux doesn't support the type of Scripting that this mod requires/needs to operate.


It's possible... would take some work, but I'm sure you could do it.

Id start looking at possibly doing some FTP with ASP
One of MANY articals on the net: http://www.aspfree.com/c/a/ASP/FTP-with-ASP/

You would have to let the script upload to the main server, then do a script that transfers the file to the remote server.<
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 12 February 2004 :  02:42:27  Show Profile  Reply with Quote
I will appoligise if I am incorrect, but I thought that vmplanet asked about the release from proeder.

I would say, you would need to have the whole script re-written, then it would not be the same type of script, would it? He asked about the current version to interact from his Windows host to his Linux host, then, no it would not be able to do it in it's current form.

There would also be security issue by using FTP with ASP if it is re-witten and you would have to leave your username and password in the script, and how long would it take for someone to get that? Linux hosting (and Windows) hosting companies require a username and password when accessing their servers via FTP, do they not?

So it is a total re-write of the script, security issue with your FTP username and password in the script, and then you have the issue of some hosts banning script uploads from another web site. Just something to ponder over for the question that was asked originally.
<

Cheers,

David Greening
Go to Top of Page

R01
Starting Member

15 Posts

Posted - 16 February 2004 :  12:44:59  Show Profile  Visit R01's Homepage  Reply with Quote
I may be an idiot...........

There is no place to config anything for this in my admin options...

All I get is this when I try and attach anything:

Add attachment to topic


You may use one of the following file extensions:

There are no extensions defined yet. Please contact the Administrator of the forum.


The maximum allowed file size is:
100 KB



Attach the selected file:

You may select a previously uploaded file from your upload directory as well:


Close Window


I would appreciate any thoughts about this.
<


I'm the one they warn you about!
Go to Top of Page

R01
Starting Member

15 Posts

Posted - 16 February 2004 :  12:49:58  Show Profile  Visit R01's Homepage  Reply with Quote
sorry for double post<


I'm the one they warn you about!

Edited by - R01 on 16 February 2004 13:02:49
Go to Top of Page
Page: of 13 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07